try{
document.domain="xiaonei.com";
}
catch(e){
}
try{
top.location.href.indexOf("x");
}
catch(e){
try{
top.location=self.location;
}
catch(e){
}
}
function isUndefined(_1){
return typeof _1=="undefined";
}
function isString(_2){
return typeof _2=="string";
}
function isElement(_3){
return _3&&_3.nodeType==1;
}
function isFunction(_4){
return typeof _4=="function";
}
function isObject(_5){
return typeof _5=="object";
}
function isArray(_6){
return Object.prototype.toString.call(_6)==="[object Array]";
}
function isNumber(_7){
return typeof _7=="number";
}
function $extend(_8,_9){
if(!_9){
return _8;
}
for(var p in _9){
_8[p]=_9[p];
}
return _8;
}
(function(){
var _b={};
$element=function(_c){
_c=_c.toLowerCase();
if(!_b[_c]){
_b[_c]=document.createElement(_c);
}
return $(_b[_c].cloneNode(false));
};
})();
function $(id){
var el;
if(isString(id)||isNumber(id)){
el=document.getElementById(id+"");
}else{
el=id;
}
if(!el){
return null;
}
if(!el._extendLevel){
XN.element.extend(el);
}
return el;
}
xn_getEl=$;
if(!Function.prototype.bind){
Function.prototype.bind=function(_f){
var _10=this;
return function(){
_10.apply(_f,arguments);
};
};
}
ge=getEl=$;
$xElement=$element;
$X=$;
var XN={namespace:function(){
var a=arguments,o=null,i,j,d;
for(i=0;i<a.length;i++){
d=a[i].split(".");
o=XN;
for(j=(d[0]=="XN")?1:0;j<d.length;j++){
o[d[j]]=o[d[j]]||{};
o=o[d[j]];
}
}
return o;
}};
XN.namespace("ui");
XN.namespace("util");
XN.namespace("app");
XN.namespace("page");
XN.namespace("config");
XN.APP=XN.App=XN.app;
XN.PAGE=XN.Page=XN.page;
XN.CONFIG=XN.Config=XN.config;
XN.DEBUG_MODE=false;
XN.debug={log:function(){
},on:function(){
XN.DEBUG_MODE=true;
if(window.console&&console.log){
XN.debug.log=function(s){
console.log(s);
};
}
},off:function(){
XN.debug.log=function(){
};
}};
XN.log=function(s){
XN.debug.log(s);
};
XN.DEBUG=XN.Debug=XN.debug;
XN.debug.On=XN.debug.on;
XN.debug.Off=XN.debug.off;
XN.env={domain:"xiaonei.com",staticRoot:"http://xnimg.cn/",swfRoot:"http://static.xiaonei.com/",wwwRoot:"http://xiaonei.com/"};
XN.ENV=XN.Env=XN.env;
XN.array={toQueryString:function(a,key){
var rt=[],t;
for(var k in a){
t=a[k];
if(isFunction(t)){
continue;
}
if(isObject(t)){
rt.push(arguments.callee(t,k));
}else{
if(/^\d+$/.test(k)){
rt.push((key||k)+"="+encodeURIComponent(t));
}else{
rt.push(k+"="+encodeURIComponent(t));
}
}
}
return rt.join("&");
},each:function(a,_1e){
if(!a){
return;
}
if(!isUndefined(a.length)||!isUndefined(a[0])){
for(var i=0,j=a.length;i<j;i++){
if(_1e.call(a,i,a[i])===false){
break;
}
}
}else{
for(var key in a){
if(!isFunction(a[key])){
if(_1e.call(a,key,a[key])===false){
break;
}
}
}
}
},include:function(a,_23){
var r=false;
XN.array.each(a,function(i,v){
if(v===_23){
r=true;
return false;
}
});
return r;
},build:function(o){
var rt=[];
for(var i=0,j=o.length;i<j;i++){
rt.push(o[i]);
}
return rt;
}};
XN.ARRAY=XN.Array=XN.array;
XN.string={nl2br:function(str){
return str.replace(/([^>])\n/g,"$1<br />");
},trim:function(str){
return str.replace(/^\s+|\s+$/g,"");
},ltrim:function(str){
return str.replace(/^\s+/,"");
},rtrim:function(str){
return str.replace(/\s+$/,"");
},strip:function(str){
return XN.string.trim(str);
},stripTags:function(str){
return str.replace(/<\/?[^>]+>/igm,"");
},escapeHTML:function(str){
return str.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");
},unescapeHTML:function(str){
return str.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&nbsp;/g," ").replace(/&quot;/g,"\"").replace(/&amp;/g,"&");
},include:function(str,key){
return str.indexOf(key)>-1;
},startsWith:function(str,key){
return str.indexOf(key)===0;
},endsWith:function(str,key){
var d=str.length-key.length;
return d>=0&&str.lastIndexOf(key)===d;
},isBlank:function(str){
return /^\s*$/.test(str);
},isEmail:function(str){
return /^[A-Z_a-z0-9-\.]+@([A-Z_a-z0-9-]+\.)+[a-z0-9A-Z]{2,4}$/.test(str);
},isMobile:function(str){
return /^((\(\d{2,3}\))|(\d{3}\-))?((1[35]\d{9})|(18[89]\d{8}))$/.test(str);
},isUrl:function(str){
return /^(http:|ftp:)\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"])*$/.test(str);
},isIp:function(str){
return /^(0|[1-9]\d?|[0-1]\d{2}|2[0-4]\d|25[0-5]).(0|[1-9]\d?|[0-1]\d{2}|2[0-4]\d|25[0-5]).(0|[1-9]\d?|[0-1]\d{2}|2[0-4]\d|25[0-5]).(0|[1-9]\d?|[0-1]\d{2}|2[0-4]\d|25[0-5])$/.test(str);
},isNumber:function(str){
return /^\d+$/.test(str);
},isZip:function(str){
return /^[1-9]\d{5}$/.test(str);
},isEN:function(str){
return /^[A-Za-z]+$/.test(str);
},isJSON:function(str){
if(!isString(str)||str===""){
return false;
}
str=str.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");
return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
},getQuery:function(key,url){
url=url||window.location.href;
var rts=[],rt;
queryReg=new RegExp("(^|\\?|&)"+key+"=([^&]*)(?=&|#|$)","g");
while((rt=queryReg.exec(url))!=null){
rts.push(decodeURIComponent(rt[2]));
}
if(rts.length==0){
return null;
}
if(rts.length==1){
return rts[0];
}
return rts;
},setQuery:function(key,_48,url){
url=url||window.location.href;
url=url.replace(new RegExp("(^|\\?|&)"+key+"=[^&]*(?=&|#|$)","g"),"");
_48=isArray(_48)?_48:[_48];
for(var i=_48.length-1;i>=0;i--){
_48[i]=encodeURIComponent(_48[i]);
}
var p=key+"="+_48.join("&"+key+"=");
return url+(/\?/.test(url)?"&":"?")+p;
}};
XN.String=XN.STRING=XN.string;
XN.string.isNum=XN.string.isNumber;
window.isJSON=XN.string.isJSON;
(function(){
runOnceFunc={};
XN.func={empty:function(){
},runOnce:function(_4c){
if(runOnceFunc[_4c]){
return null;
}
runOnceFunc[_4c]=true;
return _4c();
}};
})();
XN.FUNC=XN.Func=XN.func;
(function(){
XN.browser={IE:!!(window.attachEvent&&!window.opera),IE6:navigator.userAgent.indexOf("MSIE 6.0")>-1,IE7:navigator.userAgent.indexOf("MSIE 7.0")>-1,Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,copy:function(o){
function onfail(){
if(isElement(o)){
o.select();
}
}
var str;
if(isElement(o)){
str=o.value;
}else{
str=o;
}
if(window.clipboardData&&clipboardData.setData){
if(clipboardData.setData("text",str)){
return true;
}
}else{
XN.DO.alert({message:"\u60a8\u7684\u6d4f\u89c8\u5668\u4e0d\u652f\u6301\u811a\u672c\u590d\u5236,\u8bf7\u5c1d\u8bd5\u624b\u52a8\u590d\u5236",callBack:function(){
onfail();
}});
return false;
}
XN.DO.alert({message:"\u60a8\u7684\u6d4f\u89c8\u5668\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u811a\u672c\u8bbf\u95ee\u526a\u5207\u677f",callBack:function(){
onfail();
}});
return false;
}};
})();
XN.BROWSER=XN.Browser=XN.browser;
XN.cookie={get:function(_4f){
var _50=_4f+"=";
var ca=document.cookie.split(";");
for(var i=0;i<ca.length;i++){
var c=ca[i];
while(c.charAt(0)==" "){
c=c.substring(1,c.length);
}
if(c.indexOf(_50)==0){
return decodeURIComponent(c.substring(_50.length,c.length));
}
}
return null;
},set:function(_54,_55,_56,_57,_58,_59){
var _5a;
if(isNumber(_56)){
var _5b=new Date();
_5b.setTime(_5b.getTime()+(_56*24*60*60*1000));
_5a=_5b.toGMTString();
}else{
if(isString(_56)){
_5a=_56;
}else{
_5a=false;
}
}
document.cookie=_54+"="+encodeURIComponent(_55)+(_5a?";expires="+_5a:"")+(_57?";path="+_57:"")+(_58?";domain="+_58:"")+(_59?";secure":"");
},del:function(_5c,_5d,_5e,_5f){
XN.cookie.set(_5c,"",-1,_5d,_5e,_5f);
}};
XN.COOKIE=XN.Cookie=XN.cookie;
(function(){
var _60=XN.browser;
XN.event={isCapsLockOn:function(e){
var c=e.keyCode||e.which;
var s=e.shiftKey;
if(((c>=65&&c<=90)&&!s)||((c>=97&&c<=122)&&s)){
return true;
}
return false;
},element:function(e){
var n=e.target||e.srcElement;
return _66.resolveTextNode(n);
},relatedTarget:function(e){
var t=e.relatedTarget;
if(!t){
if(e.type=="mouseout"||e.type=="mouseleave"){
t=e.toElement;
}else{
if(e.type=="mouseover"){
t=e.fromElement;
}
}
}
return _66.resolveTextNode(t);
},resolveTextNode:function(n){
try{
if(n&&3==n.nodeType){
return n.parentNode;
}
}
catch(e){
}
return n;
},pointerX:function(_6a){
return _6a.pageX||(_6a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(_6b){
return _6b.pageY||(_6b.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
},isStrictMode:document.compatMode!="BackCompat",pageHeight:function(){
return this.isStrictMode?Math.max(document.documentElement.scrollHeight,document.documentElement.clientHeight):Math.max(document.body.scrollHeight,document.body.clientHeight);
},pageWidth:function(){
return this.isStrictMode?Math.max(document.documentElement.scrollWidth,document.documentElement.clientWidth):Math.max(document.body.scrollWidth,document.body.clientWidth);
},winWidth:function(){
return this.isStrictMode?document.documentElement.clientWidth:document.body.clientWidth;
},winHeight:function(){
return this.isStrictMode?document.documentElement.clientHeight:document.body.clientHeight;
},scrollTop:function(){
return this.isStrictMode?document.documentElement.scrollTop:document.body.scrollTop;
},scrollLeft:function(){
return this.isStrictMode?document.documentElement.scrollLeft:document.body.scrollLeft;
},stop:null,addEvent:null,delEvent:null,enableCustomEvent:function(obj){
$extend(obj,{addEvent:function(_6d,_6e){
if(!this._customEventListeners){
this._customEventListeners={};
}
var _6f=this._customEventListeners;
if(isUndefined(_6f[_6d])){
_6f[_6d]=[];
}
_6f[_6d].push(_6e);
return this;
},delEvent:function(_70,_71){
var _72=this._customEventListeners[_70];
if(_72){
for(var i=_72.length-1;i>=0;i--){
if(_72[i]==_71){
_72[i]=null;
break;
}
}
}
return this;
},fireEvent:function(_74){
if(!this._customEventListeners||!this._customEventListeners[_74]){
return;
}
var _75=this._customEventListeners[_74],ars=XN.array.build(arguments);
ars.shift();
for(var i=0,j=_75.length;i<j;i++){
if(_75[i]){
_75[i].apply(this,ars);
}
}
}});
return obj;
}};
var _66=XN.event;
if(_60.IE){
_66.stop=function(_79){
_79.returnValue=false;
_79.cancelBubble=true;
};
}else{
_66.stop=function(_7a){
_7a.preventDefault();
_7a.stopPropagation();
};
}
var _7b=function(_7c,_7d){
var p=_7c.relatedTarget;
while(p&&p!=_7d){
try{
p=p.parentNode;
}
catch(error){
p=_7d;
}
}
return p!==_7d;
};
if(window.attachEvent&&!_60.Opera){
_66.addEvent=function(_7f,_80,_81){
if(_80=="keypress"){
_80="keydown";
}
if(_80=="input"){
_80="propertychange";
}
return $(_7f).attachEvent("on"+_80,_81);
};
_66.delEvent=function(_82,_83,_84){
if(_83=="keypress"){
_83="keydown";
}
if(_83=="input"){
_83="propertychange";
}
return $(_82).detachEvent("on"+_83,_84);
};
}else{
if(window.addEventListener){
_66.addEvent=function(_85,_86,_87,_88){
_85=$(_85);
if(_86=="mouseleave"){
_85.onmouseleave=function(e){
e=e||window.event;
if(_7b(e,_85)&&_87){
_87.call(_85,e);
}
};
_85.addEventListener("mouseout",_85.onmouseleave,_88);
return _85;
}
if(_86=="keypress"&&_60.WebKit){
_86="keydown";
}
_85.addEventListener(_86,_87,_88);
return _85;
};
_66.delEvent=function(_8a,_8b,_8c,_8d){
_8a=$(_8a);
if(_8b=="mouseleave"){
_8a.removeEventListener("mouseout",_8a.onmouseleave,_8d);
return _8a;
}
if(_8b=="keypress"&&_60.WebKit){
_8b="keydown";
}
_8a.removeEventListener(_8b,_8c,_8d);
return _8a;
};
}
}
})();
XN.EVENT=XN.Event=XN.event;
(function(){
var _8e=XN.event;
var _8f=XN.array;
var _90=XN.browser;
var _91=false;
var _92=[];
function runHooks(){
if(!_92){
return;
}
XN.array.each(_92,function(i,v){
try{
v();
}
catch(e){
if(XN.DEBUG_MODE){
throw e;
}
}
});
}
var _95=null;
function createShadow(_96){
_96=_96||0.3;
var el=$element("div");
_95=el;
el.setStyle(["position:absolute;","top:0;","left:0;","background:#000;","z-index:2000;","opacity:"+_96+";","filter:alpha(opacity="+(_96*100)+");"].join(""));
if(XN.browser.IE6){
el.innerHTML=["<iframe width=\"100%\" height=\"100%\" frameBorder=\"0\" style=\"position:absolute;top:0;left:0;z-index:1;\"></iframe>","<div style=\"position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000000;z-index:2;height:expression(this.parentNode.offsetHeight);\" onmousewheel=\"return false;\"></div>"].join("");
}
function resize(){
el.hide();
el.style.height=XN.event.pageHeight()+"px";
el.style.width=XN.event.pageWidth()+"px";
el.show();
}
resize();
XN.event.addEvent(window,"resize",function(e){
if(_95&&_95.style.display!="none"){
try{
resize();
}
catch(e){
}
}
});
document.body.appendChild(el);
}
XN.dom={disable:function(_99){
if(!_95){
createShadow(_99);
}
if(XN.browser.IE6){
document.getElementsByTagName("html")[0].style.overflow="hidden";
document.body.style.overflow="hidden";
}
},enable:function(){
if(_95){
if(XN.browser.IE6){
document.getElementsByTagName("html")[0].style.overflow="";
document.body.style.overflow="";
}
_95.remove();
_95=null;
}
},insertAfter:function(_9a,_9b){
_9a=$(_9a);
_9b=$(_9b);
var _9c=_9b.parentNode;
if(_9c.lastChild==_9b){
_9c.appendChild(_9a);
}else{
_9c.insertBefore(_9a,_9b.nextSibling);
}
},getElementsByClassName:function(_9d,_9e,_9f){
var c=($(_9e)||document).getElementsByTagName(_9f||"*")||document.all;
var _a1=[];
var _a2=new RegExp("\\b"+_9d+"\\b");
_8f.each(c,function(i,v){
if(_a2.test(v.className)){
_a1.push(v);
}
});
return _a1;
},ready:function(f){
_91?f():_92.push(f);
},preloadImg:function(src){
src=isArray(src)?src:[src];
_8f.each(src,function(i,v){
new Image().src=v;
});
}};
if(_90.WebKit){
var _a9=setInterval(function(){
if(/loaded|complete/.test(document.readyState)){
_91=true;
runHooks();
clearInterval(_a9);
}
},10);
}else{
if(document.addEventListener){
document.addEventListener("DOMContentLoaded",function(){
_91=true;
runHooks();
},false);
}else{
var _a9=setInterval(function(){
try{
document.body.doScroll("left");
clearInterval(_a9);
_91=true;
runHooks();
}
catch(e){
}
},20);
}
}
})();
XN.DOM=XN.Dom=XN.dom;
XN.dom.readyDo=XN.dom.ready;
XN.dom.ready(function(){
$=ge=getEl=xn_getEl;
});
(function(){
var _aa={};
var _ab={};
function hasLoad(_ac){
return !!getFile(_ac);
}
function getFile(_ad){
return _aa[encodeURIComponent(_ad)];
}
function mark(_ae){
var obj={};
obj.file=_ae;
obj.isLoad=true;
_aa[encodeURIComponent(_ae)]=obj;
}
function addFile(_b0){
var obj={};
obj.file=_b0;
obj.isLoaded=false;
XN.EVENT.enableCustomEvent(obj);
obj.addEvent("load",function(){
this.isLoaded=true;
});
_aa[encodeURIComponent(_b0)]=obj;
var el=$element("script");
el.type="text/javascript";
el.src=_b0;
obj.element=el;
if(XN.Browser.IE){
el.onreadystatechange=function(){
if((this.readyState=="loaded"||this.readyState=="complete")&&!this.hasLoad){
this.hasLoad=true;
getFile(_b0).fireEvent("load");
}
};
}else{
el.onload=function(){
getFile(_b0).fireEvent("load");
};
}
document.getElementsByTagName("head")[0].appendChild(el);
}
function loadFile(_b3,_b4){
_b3=getFullName(_b3);
if(/\.js(\?|$)/.test(_b3)){
if(!hasLoad(_b3)){
addFile(_b3);
}
if(!_b4){
return;
}
if(getFile(_b3).isLoaded){
_b4.call(getFile(_b3));
}else{
getFile(_b3).addEvent("load",_b4);
}
}else{
if(/\.css(\?|$)/.test(_b3)){
if(hasLoad(_b3)){
return;
}
mark(_b3);
var el=$element("link");
el.rel="stylesheet";
el.type="text/css";
el.href=_b3;
document.getElementsByTagName("head")[0].appendChild(el);
if(_b4){
_b4.call(getFile(_b3));
}
}
}
}
function getFullName(_b6){
XN.func.runOnce(loadVersion);
return _ab[_b6]||_b6;
}
function getVersion(_b7){
var _b8;
if(_b8=new RegExp("("+XN.env.staticRoot+")"+"(\\d+)/([^?]*)").exec(_b7)){
_ab[_b8[1]+_b8[3]]=_b7;
}else{
if(_b8=new RegExp("(.*)\\?ver=(d+)(..*)").exec(_b7)){
_ab[_b8[1]]=_b7;
}
}
}
XN.getFileVersion=function(_b9){
XN.array.each(_b9,function(i,v){
getVersion(v);
});
};
XN.loadFile=function(_bc,_bd){
loadFile(_bc,_bd);
};
XN.loadFiles=function(_be,_bf){
var f=_be.length;
function isAllLoad(){
f--;
if(f===0&&_bf){
_bf();
}
}
XN.array.each(_be,function(i,v){
XN.loadFile(v,isAllLoad);
});
};
XN.getVersion=function(_c3){
getVersion(_c3);
};
function loadVersion(){
XN.array.each(document.getElementsByTagName("script"),function(i,v){
if(v.src){
mark(v.src);
getVersion(v.src);
}
if(v.getAttribute("vsrc")){
getVersion(v.getAttribute("vsrc"));
}
});
XN.array.each(document.getElementsByTagName("link"),function(i,v){
if(v.rel&&v.rel=="stylesheet"){
mark(v.href);
getVersion(v.href);
}
if(v.getAttribute("vhref")){
getVersion(v.getAttribute("vhref"));
}
});
}
XN.dynamicLoad=function(_c8){
XN.array.each(_c8.funcs,function(i,_ca){
window[_ca]=function(){
var ars=arguments;
window[_ca]=null;
if(_c8.file){
_c8.files=[_c8.file];
}
XN.loadFiles(_c8.files,function(){
window[_ca].apply(null,ars);
});
};
});
};
})();
(function(){
var _cc=XN.event.addEvent;
var _cd=XN.event.delEvent;
var _ce=XN.browser;
XN.element={clear:function(_cf){
_cf=$(_cf);
_cf.innerHTML="";
return _cf;
},hover:function(_d0,_d1,_d2){
_d0=$(_d0);
_d2=_d2?$(_d2):_d0;
_cc(_d0,"mouseover",function(){
_d2.addClass(_d1);
},false);
_cc(_d0,"mouseleave",function(){
_d2.delClass(_d1);
},false);
return _d0;
},scrollTo:function(_d3,_d4){
_d3=$(_d3);
_d4=_d4||"normal";
switch(_d4){
case "slow":
XN.EFFECT.scrollTo(_d3);
break;
default:
window.scrollTo(0,_d3.realTop());
break;
}
return _d3;
},visible:function(_d5){
_d5=$(_d5);
return _d5.style.display!="none"&&_d5.style.visibility!="hidden";
},toggleClass:function(_d6,_d7){
if(_d8.hasClassName(_d6,_d7)){
_d8.delClass(_d6,_d7);
}else{
_d8.addClass(_d6,_d7);
}
return $(_d6);
},hasClassName:function(_d9,_da){
return new RegExp("\\b"+_da+"\\b").test($(_d9).className);
},addClass:function(_db,_dc){
_db=$(_db);
if(_d8.hasClassName(_db,_dc)){
return _db;
}
_db.className+=" "+_dc;
return _db;
},delClass:function(_dd,_de){
_dd=$(_dd);
_dd.className=_dd.className.replace(new RegExp("\\b"+_de+"\\b"),"");
return _dd;
},show:function(_df,_e0){
_df=$(_df);
if(_df.style.display!="none"){
return;
}
_e0=_e0||"normal";
switch(_e0){
case "normal":
_df.style.display="";
break;
case "fade":
XN.EFFECT.fadeIn(_df,function(e){
e.style.display="";
});
break;
case "slide":
XN.EFFECT.slideOpen(_df);
break;
case "delay":
setTimeout(function(){
_df.style.display="";
},2000);
break;
}
return _df;
},hide:function(_e2,_e3){
_e2=$(_e2);
if(_e2.style.display=="none"){
return;
}
_e3=_e3||"normal";
switch(_e3){
case "normal":
_e2.style.display="none";
break;
case "fade":
XN.EFFECT.fadeOut(_e2,function(e){
e.style.display="none";
});
break;
case "slide":
XN.EFFECT.slideClose(_e2);
break;
case "delay":
setTimeout(function(){
_e2.style.display="none";
},2000);
break;
}
return _e2;
},remove:function(_e5){
var _e5=$(_e5);
_e5.parentNode.removeChild(_e5);
return _e5;
},setStyle:function(_e6,_e7){
var _e6=$(_e6);
_e6.style.cssText+=";"+_e7;
return _e6;
},getStyle:function(_e8,_e9){
_e8=$(_e8);
_e9=_e9=="float"?"cssFloat":_e9;
var _ea=_e8.style[_e9];
if(!_ea){
var css=document.defaultView.getComputedStyle(_e8,null);
_ea=css?css[_e9]:null;
}
if(_e9=="opacity"){
return _ea?parseFloat(_ea):1;
}
return _ea=="auto"?null:_ea;
},addEvent:function(){
_cc.apply(null,arguments);
return arguments[0];
},delEvent:function(){
_cd.apply(null,arguments);
return arguments[0];
},addChild:function(_ec,_ed){
_ec=$(_ec);
if(isString(_ed)){
var _ee=(_ed.substring(0,1)=="#")?$(_ed.substring(1,_ed.length)):_ed;
if(isString(_ee)){
_ec.innerHTML+=_ee;
}else{
_ec.appendChild(_ee);
}
}else{
if(isElement(_ed)){
_ec.appendChild(_ed);
}else{
if(_ed.iAmUIelement){
_ec.appendChild($(_ed.frame));
}else{
if(_ed.iAmXmlhttp){
_ed.fillTo=_ec;
_ec.startLoading();
}
}
}
}
return _ec;
},delChild:function(_ef,_f0){
_f0=$(_f0);
_f0.remove();
return $(_ef);
},setContent:function(_f1,c){
_f1=$(_f1);
_f1.innerHTML="";
_f1.addChild(c);
return _f1;
},getPosition:function(_f3,_f4){
_f4=$(_f4)||document.body;
_f3=$(_f3);
var rl=0;
var rt=0;
var p=_f3;
try{
while(p&&p!=_f4){
rl+=p.offsetLeft;
rt+=p.offsetTop;
p=p.offsetParent;
}
}
catch(e){
}
return {"left":rl,"top":rt};
},realLeft:function(_f8,p){
return _d8.getPosition(_f8,p||null).left;
},realTop:function(_fa,p){
return _d8.getPosition(_fa,p||null).top;
},startLoading:function(_fc,msg){
_fc=$(_fc);
_fc.innerHTML="<center><img src=\""+XN.ENV.staticRoot+"img/indicator.gif\" />"+(msg||"\u52a0\u8f7d\u4e2d...")+"</center>";
return _fc;
},stopLoading:function(_fe){
_fe=$(_fe);
return _fe;
}};
XN.element.extend=function(_ff){
if(_ff._extendLevel){
return _ff;
}
var _100=_d8.extend.cache;
for(var m in _d8){
if(!(m in _ff)){
_ff[m]=_100.findOrStore(_d8[m]);
}
}
return _ff;
};
XN.element.extend.cache={findOrStore:function(_102){
return this[_102]=this[_102]||function(){
return _102.apply(null,[this].concat(XN.array.build(arguments)));
};
}};
var _d8=XN.element;
if(_ce.IE){
XN.element.getStyle=function(_103,_104){
_103=$(_103);
_104=(_104=="float"||_104=="cssFloat")?"styleFloat":_104;
var _105=_103.style[_104];
if(!_105&&_103.currentStyle){
_105=_103.currentStyle[_104];
}
if(_104=="opacity"){
if(_105=(_103.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){
if(_105[1]){
return parseFloat(_105[1])/100;
}
}
return 1;
}
if(_105=="auto"){
if((_104=="width"||_104=="height")&&(_103.getStyle("display")!="none")){
return _103["offset"+(_104=="width"?"Width":"Height")]+"px";
}
return null;
}
return _105;
};
}
if(document.addEventListener){
XN.element.setOpacity=function(_106,_107){
_106=$(_106);
_106.style.opacity=_107;
return _106;
};
}else{
XN.element.setOpacity=function(_108,_109){
_108=$(_108);
_108.style.zoom=1;
_108.style.filter="Alpha(opacity="+Math.ceil(_109*100)+")";
return _108;
};
}
})();
XN.ELEMENT=XN.Element=XN.element;
XN.namespace("net");
XN.net.proxys={};
XN.net.sendForm=function(_10a){
XN.log("send form");
_10a.data=XN.FORM.serialize(_10a.form);
return new XN.net.xmlhttp(_10a);
};
XN.net.xmlhttp=function(_10b){
var This=this;
if(!XN.net.cache){
XN.net.cache=new XN.util.cache();
}
var ars=arguments;
if(ars.length>1){
this.url=ars[0]||null;
this.data=ars[1]||"";
this.onSuccess=ars[2];
$extend(this,ars[3]);
init(window);
return this;
}
$extend(this,_10b);
var _10e;
if(this.useCache&&(_10e=XN.net.cache.get(this.url+encodeURIComponent(this.data)))){
this.transport={};
this.transport.responseText=_10e;
setTimeout(function(){
This._onComplete();
This._onSuccess();
},0);
return this;
}
function getDomain(link){
var a=$element("a");
a.href=link;
return a.hostname;
}
if(/^http/.test(this.url)){
var cd=getDomain(window.location.href);
var nd=getDomain(this.url);
if(cd!=nd){
if(XN.net.proxys[nd]){
init(XN.net.proxys[nd]);
return This;
}else{
var _113=$element("iframe").hide();
_113.src="http://"+nd+"/ajaxProxy.html";
document.body.appendChild(_113);
XN.event.addEvent(_113,"load",function(){
try{
init(_113.contentWindow);
XN.net.proxys[nd]=_113.contentWindow;
}
catch(e){
}
});
return This;
}
}else{
init(window);
}
}else{
init(window);
}
function init(w){
This.transport=This.getTransport(w);
if(This.url&&This.url!==""){
This.send(This.method);
}
}
};
XN.net.xmlhttp.prototype={url:null,data:"",onSuccess:null,onFailure:null,onError:null,fillTo:null,method:"post",asynchronous:true,transport:null,headers:null,iAmXmlhttp:true,useCache:false,abort:function(){
this.transport.abort();
},send:function(_115){
var _url;
if(_115=="get"&&this.data!==""){
_url=this.url+(/\?/.test(this.url)?"&":"?")+this.data;
}else{
_url=this.url;
}
if(this.asynchronous){
this.transport.onreadystatechange=this.onStateChange.bind(this);
}
this.transport.open(_115,_url,this.asynchronous);
this.transport.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
if(this.headers!==null){
for(var i in this.headers){
this.transport.setRequestHeader(i,this.headers[i]);
}
}
this.transport.send(_115=="post"?this.data:null);
},_onSuccess:function(obj){
var _119=this.transport;
if(this.fillTo!==null){
try{
this.fillTo.stopLoading();
}
catch(e){
}
this.fillTo.innerHTML=_119.responseText;
}
try{
if(this.onSuccess){
this.onSuccess.call(null,_119);
}
}
catch(e){
if(XN.DEBUG_MODE){
throw e;
}
}
},_onComplete:function(obj){
var _11b=this.transport;
try{
if(this.onComplete){
this.onComplete.call(null,_11b);
}
}
catch(e){
if(XN.DEBUG_MODE){
throw e;
}
}
},onStateChange:function(){
var _11c=this.transport;
if(_11c.readyState==4){
this._onComplete();
if(_11c.status==undefined||_11c.status==0||(_11c.status>=200&&_11c.status<300)){
if(this.useCache){
XN.net.cache.add(this.url+encodeURIComponent(this.data),this.transport.responseText);
}
this._onSuccess();
}else{
(this.onError||this.onFailure||XN.func.empty).call(null,_11c);
}
}
}};
if(XN.browser.IE){
XN.net.xmlhttp.prototype.getTransport=function(w){
if(w!==window){
return w.getTransport();
}
try{
return new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
return new ActiveXObject("Microsoft.XMLHTTP");
}
};
}else{
XN.net.xmlhttp.prototype.getTransport=function(w){
return new w.XMLHttpRequest();
};
}
XN.NET=XN.Net=XN.net;
XN.net.ajax=XN.net.xmlhttp;
$extend(XN.net.xmlhttp.prototype,{get:function(url,data,_121,_122){
this.url=url;
this.data=data;
this.onSuccess=_121;
$extend(this,_122);
this.send("get");
},post:function(url,data,_125,_126){
this.url=url;
this.data=data;
this.onSuccess=_125;
$extend(this,_126);
this.send("post");
}});
if(typeof Ajax=="undefined"){
Ajax={};
Ajax.Request=function(url,o){
var p=o.parameters;
o["url"]=url;
o["data"]=p;
delete o.parameters;
return new XN.net.xmlhttp(o);
};
}
XN.template={};
XN.template.mediaPlayer=function(o){
return ["<object classid=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" width=\""+(o.width||"352")+"\" height=\""+(o.height||"70")+"\" >\n","<param name=\"autostart\" value=\""+(o.autostart||"1")+"\" >\n","<param name=\"showstatusbar\" value=\""+(o.showstatusbar||"1")+"\">\n","<param name=\"filename\" value=\""+o.filename+"\">\n","<embed type=\"application/x-oleobject\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" ","flename=\"mp\"","autostart=\""+(o.autostart||"1")+"\" showstatusbar=\""+(o.showstatusbar||"1")+"\" ","src=\""+o.filename+"\" width=\""+(o.width||"352")+"\" height=\""+(o.height||"70")+"\"></embed>"].join("");
};
XN.template.flashPlayer=function(o){
return "<embed src=\""+XN.ENV.staticRoot+"/swf/player.swf?url="+o.filename+"&Rwid="+(o.width||"450")+"&Autoplay="+(o.autostart||"1")+"\" wmode=\""+(o.wmode||"transparent")+"\" loop=\"false\" menu=\"false\" quality=\"high\" scale=\"noscale\" salign=\"lt\" bgcolor=\"#ffffff\" width=\""+(o.width||"450")+"\" height=\""+(o.height||"30")+"\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
};
XN.template.flash=function(o){
return "&nbsp;<embed src=\""+o.filename+"\" type=\"application/x-shockwave-flash\" "+"width=\""+(o.width||"320")+"\" height=\""+(o.height||"240")+"\" allowFullScreen=\"true\" wmode=\""+(o.wmode||"transparent")+"\" allowScriptAccess=\"always\"></embed>";
};
XN.Template=XN.TEMPLATE=XN.template;
XN.namespace("util");
XN.util.cache=function(_12d){
$extend(this,_12d);
this._cacheData=[];
};
XN.util.cache.prototype={cacheLength:null,_cacheData:null,isExist:function(key){
return this.get(key);
},add:function(key,_130){
if(!isUndefined(this.isExist(key))){
return;
}
if(this.cacheLength&&this.cacheLength==this._cacheData.length){
this._cacheData.shift();
}
this._cacheData.push({"key":key,"value":_130});
},get:function(key){
for(var i=this._cacheData.length-1;i>=0;i--){
if(this._cacheData[i].key==key){
return this._cacheData[i].value;
}
}
},clear:function(){
this._cacheData=[];
}};
XN.UTIL=XN.Util=XN.util;
XN.util.DS_JSON=function(p){
$extend(this,p);
};
XN.util.DS_JSON.prototype={DS_TYPE:"JSON",url:null,queryParam:"query",attachParam:"",rootKey:null,_request:null,query:function(v,_135){
var This=this;
try{
this._request.abort();
}
catch(e){
}
function parseDS_JSON(r){
r=r.responseText;
var pp;
try{
var rt=XN.JSON.parse(r);
if(This.rootKey&&rt[This.rootKey]){
pp=rt[This.rootKey];
}else{
pp=rt;
}
}
catch(e){
pp=[];
}
_135(pp);
}
this._request=new XN.net.xmlhttp({url:this.url,data:this.queryParam+"="+encodeURIComponent(v)+"&"+this.attachParam,method:"get",onSuccess:parseDS_JSON});
}};
XN.ui.DS_JSON=XN.util.DS_JSON;
XN.util.DS_friends=function(p){
var ds=new XN.util.DS_JSON(p);
ds.queryParam="p";
ds.rootKey="candidate";
ds.net="";
ds.group="";
ds.param=XN.json.build(p.param||{});
var _13c=isUndefined(p.limit)?24:p.limit;
ds.query=function(name,_13e){
XN.log("start query");
name=name.replace(/[^a-zA-Z\u0391-\uFFE5]/g,"");
if(XN.string.isBlank(name)&&this.group==""&&this.net==""){
_13e([]);
return;
}
var p=["{\"init\":false,","\"qkey\":\""+this.qkey+"\",","\"uid\":true,","\"uname\":true,","\"uhead\":true,","\"limit\":"+_13c+",","\"param\":"+this.param+",","\"query\":\""+name+"\",","\"group\":\""+this.group+"\",","\"net\":\""+this.net+"\"","}"].join("");
XN.util.DS_JSON.prototype.query.call(this,p,_13e);
};
return ds;
};
XN.ui.DS_friends=XN.util.DS_friends;
XN.util.DS_Array=function(p){
$extend(this,p);
this.init();
};
XN.util.DS_Array.prototype={DS_TYPE:"array",data:null,searchKey:null,init:function(){
var key=this.searchKey,_142=this._index=[];
XN.array.each(this.data,function(i,v){
_142.push(v[key]);
});
},query:function(v,_146){
_146(this._search(v));
},_search:function(v){
var keys=this._index,data=this.data,rt=[],reg=new RegExp("^"+v,"i");
XN.array.each(keys,function(i,v){
if(reg.test(v)){
rt.push(data[i]);
}
});
return rt;
}};
XN.ui.DS_Array=XN.util.DS_Array;
XN.util.DS_XHR=function(p){
$extend(this,p);
};
XN.util.DS_XHR.prototype={url:null,queryParam:"query",_request:null,query:function(v,_150){
var This=this;
try{
this._request.abort();
}
catch(e){
}
function parseDS_XML(r){
r=r.responseXML;
var rt=[];
function getResult(r){
var tmp={};
XN.array.each(r.childNodes,function(i,v){
tmp[v.tagName.toLowerCase()]=v.firstChild.nodeValue;
});
return tmp;
}
try{
var rs=r.getElementsByTagName("Result");
XN.array.each(rs,function(i,v){
rt.push(getResult(v));
});
}
catch(e){
rt=[];
}
_150(rt);
}
this._request=new XN.net.xmlhttp({url:this.url,data:this.queryParam+"="+encodeURIComponent(v),onSuccess:parseDS_XML});
}};
XN.ui.DS_XHR=XN.util.DS_XHR;
(function(){
var _15b={};
XN.util.hotKey={add:function(key,func,obj){
key=String(key).toLowerCase();
var ctrl=false;
var alt=false;
var _161=false;
var _162=null;
if(/^\d+$/.test(key)){
_162=parseInt(key);
}else{
ctrl=/ctrl|ctr|c/.test(key);
alt=/alt|a/.test(key);
_161=/shift|s/.test(key);
if(/\d+/.test(key)){
_162=parseInt(/\d+/.exec(key)[0]);
}else{
_162=false;
}
}
_15b[key]=_15b[key]||{};
_15b[key][func]=function(e){
e=e||window.event;
code=e.keyCode;
if(ctrl&&!e.ctrlKey){
return;
}
if(alt&&!e.altKey){
return;
}
if(_161&&!e.shiftKey){
return;
}
if(_162&&code!==_162){
return;
}
func.call(obj||null);
XN.event.stop(e);
};
XN.event.addEvent(document,"keydown",_15b[key][func]);
},del:function(key,func){
key=String(key).toLowerCase();
XN.event.delEvent(document,"keydown",_15b[key][func]);
delete _15b[key][func];
}};
})();
(function(){
var id=0;
XN.util.createObjID=function(){
id++;
return id;
};
})();
XN.DO={};
(function(){
var _167=null;
var _168=null;
XN.DO.alert=function(_169,_16a,type,X,Y,w,h,_170){
try{
_167.hide();
}
catch(e){
}
var _171={type:"normal",width:400,button:"\u786e\u5b9a",callBack:XN.func.empty,autoHide:0,params:{}};
if(!isString(_169)){
$extend(_171,_169);
}
if(isString(_169)||arguments.length>1){
var ars=arguments;
XN.array.each(["message","title","type","X","Y","width","height","callBack"],function(i,v){
if(ars[i]){
_171[v]=ars[i];
}
});
}
var _175=new XN.ui.dialog(_171).setType(_171.type).setTitle(_171.title||(_171.type=="error"?"\u9519\u8bef\u63d0\u793a":"\u63d0\u793a")).setBody(_171.msg||_171.message||"").setWidth(_171.width).setHeight(_171.height).setX(_171.X).setY(_171.Y).addButton({text:(_171.yes||_171.button),onclick:function(){
return _171.callBack.call(_175);
}}).show();
_167=_175;
if(_171.noFooter){
_175.footer.hide();
}
if(_171.noHeader){
_175.header.hide();
}
try{
_175.getButton(_171.button).focus();
}
catch(e){
}
if(_171.autoHide){
_175.autoHide(_171.autoHide);
}
return _175;
};
var _176=null;
XN.DO.confirm=function(_177,_178,_179,yes,no,X,Y,w,h){
try{
_176.remove();
}
catch(e){
}
var _180={type:"normal",width:400,yes:"\u786e\u5b9a",no:"\u53d6\u6d88",callBack:XN.func.empty,focus:null,params:{}};
if(!isString(_177)){
$extend(_180,_177);
}
if(isString(_177)||arguments.length>1){
var ars=arguments;
XN.array.each(["message","title","callBack","yes","no","X","Y","w","h"],function(i,v){
if(ars[i]){
_180[v]=ars[i];
}
});
}
var _184=new XN.ui.dialog(_180).setType(_180.type).setTitle(_180.title||(_180.type=="error"?"\u9519\u8bef\u63d0\u793a":"\u63d0\u793a")).setBody(_180.msg||_180.message||"").setWidth(_180.width).setHeight(_180.height).setX(_180.X).setY(_180.Y).addButton({text:(_180.submit||_180.yes),onclick:function(){
return _180.callBack.call(_184,true);
}}).addButton({text:(_180.cancel||_180.no),onclick:function(){
return _180.callBack.call(_184,false);
}}).show();
_184.getButton(_180.cancel||_180.no).addClass("gray");
if(_180.focus=="submit"){
_180.focus=_180.submit;
}else{
if(_180.focus=="cancel"){
_180.focus=_180.cancel;
}
}
_184.getButton(_180.focus||_180.submit||_180.yes).focus();
_176=_184;
return _184;
};
XN.DO.showMessage=XN.DO.showMsg=function(msg,_186,time){
XN.DO.alert({msg:msg,title:(_186||"\u63d0\u793a"),noFooter:true,autoHide:(time||2)});
};
XN.DO.showError=function(msg,_189,time){
XN.DO.alert({msg:msg,type:"error",title:(_189||"\u9519\u8bef\u63d0\u793a"),noFooter:true,autoHide:(time||2)});
};
})();
XN.json={_ESCAPES:/\\["\\\/bfnrtu]/g,_VALUES:/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS:/(?:^|:|,)(?:\s*\[)+/g,_INVALID:/^[\],:{}\s]*$/,_SPECIAL_CHARS:/["\\\x00-\x1f\x7f-\x9f]/g,_PARSE_DATE:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/,_CHARS:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"},dateToString:function(d){
function _zeroPad(v){
return v<10?"0"+v:v;
}
return "\""+d.getUTCFullYear()+"-"+_zeroPad(d.getUTCMonth()+1)+"-"+_zeroPad(d.getUTCDate())+"T"+_zeroPad(d.getUTCHours())+":"+_zeroPad(d.getUTCMinutes())+":"+_zeroPad(d.getUTCSeconds())+"Z\"";
},stringToDate:function(str){
if(XN.JSON._PARSE_DATE.test(str)){
var d=new Date();
d.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);
d.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);
return d;
}
},parse:function(str){
return eval("("+str+")");
},build:function(o,w,d){
var m=XN.JSON._CHARS,_194=XN.JSON._SPECIAL_CHARS,_195=[];
var _196=function(c){
if(!m[c]){
var a=c.charCodeAt();
m[c]="\\u00"+Math.floor(a/16).toString(16)+(a%16).toString(16);
}
return m[c];
};
var _199=function(s){
return "\""+s.replace(_194,_196)+"\"";
};
var _19b=XN.JSON.dateToString;
var _19c=function(o,w,d){
var t=typeof o,i,len,j,k,v,vt,a;
if(t==="string"){
return _199(o);
}
if(t==="boolean"||o instanceof Boolean){
return String(o);
}
if(t==="number"||o instanceof Number){
return isFinite(o)?String(o):"null";
}
if(o instanceof Date){
return _19b(o);
}
if(isArray(o)){
for(i=_195.length-1;i>=0;--i){
if(_195[i]===o){
return "null";
}
}
_195[_195.length]=o;
a=[];
if(d>0){
for(i=o.length-1;i>=0;--i){
a[i]=_19c(o[i],w,d-1)||"null";
}
}
_195.pop();
return "["+a.join(",")+"]";
}
if(t==="object"){
if(!o){
return "null";
}
for(i=_195.length-1;i>=0;--i){
if(_195[i]===o){
return "null";
}
}
_195[_195.length]=o;
a=[];
if(d>0){
if(w){
for(i=0,j=0,len=w.length;i<len;++i){
if(typeof w[i]==="string"){
v=_19c(o[w[i]],w,d-1);
if(v){
a[j++]=_199(w[i])+":"+v;
}
}
}
}else{
j=0;
for(k in o){
if(typeof k==="string"&&typeof o[k]!="undefined"){
v=_19c(o[k],w,d-1);
if(v){
a[j++]=_199(k)+":"+v;
}
}
}
}
}
_195.pop();
return "{"+a.join(",")+"}";
}
return undefined;
};
d=d>=0?d:1/0;
return _19c(o,w,d);
}};
XN.JSON=XN.Json=XN.json;
XN.USER=XN.User={};
XN.USER.me=function(_1a8){
};
currentUser={};
XN.EVENT.enableCustomEvent(currentUser);
XN.USER.addFriendAction=function(p){
this.config={commentLength:45,needComment:true,requestURI:"/ajax_request_friend.do"};
$extend(this.config,p);
};
XN.USER.addFriendAction.prototype={getConfig:function(key){
return this.config[key];
},send:function(id,why,from){
var This=this;
if(this.getConfig("needComment")){
if(XN.STRING.isBlank(why)){
this.fireEvent("checkError","\u60a8\u8f93\u5165\u7684\u4fe1\u606f\u4e0d\u80fd\u4e3a\u7a7a");
return;
}
}
if(why.length>this.getConfig("commentLength")){
this.fireEvent("checkError","\u60a8\u8f93\u5165\u7684\u4fe1\u606f\u4e0d\u80fd\u8d85\u8fc7"+this.getConfig("commentLength")+"\u4e2a\u5b57\u7b26");
return;
}
var data="id="+id+"&why="+why+"&from="+from;
this.fireEvent("beforePost");
new XN.NET.xmlhttp({url:this.getConfig("requestURI"),"data":data,onSuccess:function(r){
r=r.responseText;
This.fireEvent("success",id,r,from);
if(!window.currentUser){
return;
}
if(currentUser.fireEvent){
currentUser.fireEvent("addFriendSuccess",id,r,from);
}
if(currentUser.onaddFriendSuccess){
currentUser.onaddFriendSuccess(id,r);
}
},onError:function(){
This.fireEvent("error",id,from);
if(!window.currentUser){
return;
}
currentUser.fireEvent("addFriendError",id,r,from);
}});
}};
XN.EVENT.enableCustomEvent(XN.USER.addFriendAction.prototype);
XN.DOM.readyDo(function(){
var _1b1=null;
var user=null;
function loadingDialog(){
_1b1=XN.DO.confirm({title:"\u5c06"+user.name+"\u52a0\u4e3a\u597d\u53cb?",msg:"<div style=\"font-size: 14px;  height:100px; line-height: 1.8em; padding-left: 20px;\" class=\"clearfix\"><div style=\"padding: 4px; background: transparent url("+XN.ENV.staticRoot+"imgpro/bg/picholder59.gif) no-repeat scroll 0% 0%;width: 59px; height: 59px; float: left;\"><a href=\"#\" style=\"background: transparent url("+user.head_url+") no-repeat scroll center center;height: 50px; width: 50px; display: block;\">&nbsp;</a></div><div style=\"margin-left: 10px; height: 30px; float: left;width:240px;font-size:12px;\"><h3 style=\"margin-top:15px;\"><img style=\"display:block;float:left;margin:5px 10px 0 0;\" src=\""+XN.ENV.staticRoot+"/img/indicator.gif\" />Loading...</h3></div></div>",width:400});
_1b1.footer.style.display="none";
}
function getMessage(_1b3,_1b4,_1b5){
var _1b6=_1b3==""?"none":"block";
var _1b7=_1b4?"none":"block";
var html=["<div style=\"width:370px;padding:4px;color:#EF4223;background-color:#FEFFCF;position:relative;top:-10px;left:-10px;_margin-bottom:0;\">\u9700\u8981\u901a\u8fc7<em>",user.name,"</em>\u7684\u9a8c\u8bc1\u624d\u80fd\u52a0",_1b5,"\u4e3a\u597d\u53cb\uff01</div>","<div style=\"padding: 4px; background: transparent url(",XN.ENV.staticRoot,"imgpro/bg/picholder59.gif) no-repeat scroll 0% 0%;width: 59px; height: 59px; float: left;\"><a href=\"#\" style=\"background: transparent url(",user.head_url,") no-repeat scroll center center; height: 50px; width: 50px; display: block;\">&nbsp;</a></div>","<div id=\"addFriendAlert\" style=\"float: left;width:265px;\">","<h4 style=\"display:",_1b6,";margin-bottom:10px;\">",user.name,"\u8bf4: <span style=\"font-weight: 400;\">",_1b3,"</span></h4>","<p style=\"margin: 0 0 10px 0;\">","<textarea id=\"addFriendMessage\" style=\"border: 1px solid #B8D4E8; width: 100%; height:50px;color: gray;\" title=\"\u9644\u52a0\u4fe1\u606f(\u9009\u586b\uff0c45\u5b57\u5185)\" onfocus=\"if(this.value==this.title)this.value='';\" onblur=\"if(this.value=='')this.value=this.title;\">\u9644\u52a0\u4fe1\u606f(\u9009\u586b\uff0c45\u5b57\u5185)</textarea>","</p>","<div style=\"display:",_1b7,";clear:both;text-align:center;\"><a style=\"font-size:12px;\" target=\"_blank\" href=\"http://head.upload.xiaonei.com/Upload.do?from=friend\">\u4f7f\u7528\u771f\u5b9e\u5934\u50cf\uff0c\u63d0\u9ad8\u8bf7\u6c42\u901a\u8fc7\u7387</a></div>","</div><div style=\"clear:both;\"></div>"];
return html.join("");
}
function requestDialog(_1b9,_1ba,_1bb){
_1b1=XN.DO.confirm({title:"\u5c06"+user.name+"\u52a0\u4e3a\u597d\u53cb?",msg:getMessage(_1b9,_1ba,_1bb),width:400,callBack:function(r){
if(r){
var obj=$("addFriendMessage");
var why=obj.value==obj.title?"":obj.value;
getAction().send(user.id,why,user.from);
}
}});
_1b1.footer.style.display="";
}
function beforePost(){
$("addFriendAlert").innerHTML="\u6b63\u5728\u53d1\u9001\u8bf7\u6c42...";
_1b1.footer.hide();
try{
_1b1.preventHide();
}
catch(e){
_1b1.show();
}
}
function recommendFriend(){
if(typeof showRecommendedFriendDialog!="undefined"){
showRecommendedFriendDialog(user.id,user.name,1,true);
}else{
XN.loadFile("http://xnimg.cn/csspro/apps/profile.css");
XN.loadFile("http://xnimg.cn/jspro/xn.app.recommendFriend.js",function(){
showRecommendedFriendDialog(user.id,user.name,1,true);
});
}
}
function success(id,_1c0){
var This=this;
if(isJSON(_1c0)){
var msg=XN.JSON.parse(_1c0);
}else{
var msg={code:0,targetfriendcount:100,message:_1c0};
}
if(msg.code==0||msg.code==1){
if(msg.targetfriendcount<=12){
_1b1.hide();
recommendFriend();
}else{
$("addFriendAlert").innerHTML=msg.message;
setTimeout(function(){
_1b1.hide();
},1500);
}
if(user.action){
try{
eval(user.action);
}
catch(e){
}
}
if(user.callback){
user.callback(user.id);
}
}else{
_1b1.hide();
XN.DO.alert({title:"\u597d\u53cb\u7533\u8bf7\u5931\u8d25",message:"<p style='margin:10px;'>"+msg.message+"</p>"});
}
}
function initUser(args){
if(!/^\d+$/.test(args[0])){
user={id:args[1],name:args[2],head_url:args[3],star:true,from:args[4],action:args[5]};
}else{
user={id:args[0],name:args[1],head_url:args[2],star:args[3],from:args[4],callback:args[5]};
}
}
function getAction(){
var _1c4=new XN.USER.addFriendAction({needComment:false});
_1c4.addEvent("beforePost",beforePost);
_1c4.addEvent("success",success);
_1c4.addEvent("checkError",function(_1c5){
_1b1.hide();
XN.DO.showError(_1c5,"\u9519\u8bef\u63d0\u793a",2);
setTimeout(function(){
_1b1.show();
},2000);
});
_1c4.addEvent("error",function(id,_1c7){
_1b1.hide();
XN.DO.showError(_1c7);
});
return _1c4;
}
window.showRequestFriendDialog=function(uid,name,head,star,from,_1cd){
initUser(arguments);
loadingDialog();
new XN.NET.xmlhttp({url:"http://xiaonei.com/GetFriendCue.do",method:"get",data:"id="+user.id,onSuccess:function(r){
var _1cf=XN.JSON.parse(r.responseText);
var _1d0=_1cf.type==0?"":_1cf.content;
var _1d1=_1cf.isTrue?true:false;
var _1d2=_1cf.ta===false?"\u5979":"\u4ed6";
requestDialog(_1d0,_1d1,_1d2);
},onError:function(r){
_1b1.hide();
requestDialog("",true,"TA");
}});
};
});
(function(){
writepipe=function(uin,nick){
if(uin>0){
var s=GetCookie("_pipe");
if(s){
s+=":";
}
SetCookie("_pipe",s+uin+":"+escape(nick),null,"/","xiaonei.com");
}
var _1d7=GetCookie("_wi");
if("opening"==_1d7){
}else{
if("running"==_1d7){
}else{
SetCookie("_wi","opening",null,"/",XN.ENV.domain);
window.wiw=window.open("http://xiaonei.com/webpager.do?toid="+uin,"_blank","height=600,width=650,resizable=yes,location=yes");
if(window.wiw_checker){
window.clearInterval(window.wiw_checker);
}
window.wiw_checker=window.setInterval(function(){
if(window.wiw.closed){
window.clearInterval(window.wiw_checker);
SetCookie("_wi","",null,"/",XN.ENV.domain);
}
},1000);
return true;
}
}
try{
if(window.wiw){
window.wiw.focus();
}
}
catch(e){
}
return false;
};
talkto=function(uin,nick,tiny,_1db){
try{
var a=new ActiveXObject("xntalk.Application");
if(a){
a.openChat("",uin);
return true;
}
}
catch(e){
}
if(top.frames["imengine"].gPagerType==4){
if(top.frames["imengine"].imHelper.isLoginUser()){
var tabs=top.frames["imengine"].imui.chatTabs;
tabs.onActivateWidget(uin,nick,tiny,_1db);
tabs.switchFocus(uin);
return true;
}
}
try{
writepipe(uin,nick);
}
catch(e){
}
};
jump_and_download=function(link){
if(XN.BROWSER.IE){
window.open(link,"download_window","toolbar=0,location=no,directories=0,status=0,scrollbars=0,resizeable=0,width=1,height=1,top=0,left=0");
window.focus();
}
};
})();
function GetCookieVal(_70){
var _71=document.cookie.indexOf(";",_70);
if(_71==-1){
_71=document.cookie.length;
}
return unescape(document.cookie.substring(_70,_71));
}
function GetCookie(_72){
var arg=_72+"=";
var _74=arg.length;
var _75=document.cookie.length;
var i=0;
while(i<_75){
var j=i+_74;
if(document.cookie.substring(i,j)==arg){
return GetCookieVal(j);
}
i=document.cookie.indexOf(" ",i)+1;
if(i==0){
break;
}
}
return null;
}
function SetCookie(_78,_79){
var _7a=SetCookie.arguments;
var _7b=SetCookie.arguments.length;
var _7c=(_7b>2)?_7a[2]:null;
var _7d=(_7b>3)?_7a[3]:null;
var _7e=(_7b>4)?_7a[4]:null;
var _7f=(_7b>5)?_7a[5]:false;
document.cookie=_78+"="+escape(_79)+((_7c==null)?"":("; expires="+_7c.toGMTString()))+((_7d==null)?"":("; path="+_7d))+((_7e==null)?"":("; domain="+_7e))+((_7f==true)?"; secure":"");
}
var IMHack={};
(function(){
var _1ef=function(_1f0,type,_1f2){
if(!_1f2.$$guid){
_1f2.$$guid=_1ef.guid++;
}
if(!_1f0.events){
_1f0.events={};
}
var _1f3=_1f0.events[type];
if(!_1f3){
_1f3=_1f0.events[type]={};
if(_1f0["on"+type]){
_1f3[0]=_1f0["on"+type];
}
}
_1f3[_1f2.$$guid]=_1f2;
_1f0["on"+type]=_1f4;
};
_1ef.guid=1;
var _1f5=function(_1f6,type,_1f8){
if(_1f6.events&&_1f6.events[type]){
delete _1f6.events[type][_1f8.$$guid];
}
};
var _1f4=function(_1f9){
_1f9=_1f9||window.event;
var _1fa=this.events[_1f9.type];
for(var i in _1fa){
this.$$handleEvent=_1fa[i];
this.$$handleEvent(_1fc(_1f9));
}
};
var _1fc=function(_1fd){
if(_1fd.cancelBubble){
_1fd.stopPropagation=function(){
_1fd.cancelBubble=true;
};
}
return _1fd;
};
var css=function(ele,prop){
for(i in prop){
ele.style[i]=prop[i];
}
};
var _201=function(){
var h=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
return Math.max(h,_203());
};
var _204=function(){
var h=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);
return Math.max(h,_206());
};
var _206=function(){
return (document.documentElement.clientWidth==0?document.body.clientWidth:document.documentElement.clientWidth);
};
var _203=function(){
return (document.documentElement.clientHeight==0?document.body.clientHeight:document.documentElement.clientHeight);
};
var _207=function(){
return Math.max(document.body.scrollTop,document.documentElement.scrollTop);
};
var _208=function(){
return Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
};
var _209=function(obj){
var _20b={display:obj.style.display,visible:obj.style.visibility};
css(obj,{display:"",visible:"visibility"});
var dim={w:obj.offsetWidth,h:obj.offsetHeight};
css(obj,_20b);
return dim;
};
var _20d=function(_20e,_20f){
var _210=[];
var _211=_20e.getElementsByTagName("*");
var _212=new RegExp("\\b"+_20f+"\\b");
for(var i=0,j=0;i<_211.length;i++){
if(_212.test(_211[i].className)){
_210[j++]=_211[i];
}
}
return _210;
};
var _215=null;
var _216=null;
var _217=function(){
css(_215,{display:"none"});
clearTimeout(_216);
_216=setTimeout(function(){
var dim=_209(_215);
var top=_207()+_203()-25;
css(_215,{display:"block",top:top+"px",right:"0px"});
},500);
};
IMHack.hackToolBar=function(){
_215=document.getElementById("wpiroot");
css(_215,{position:"absolute",right:0});
_1ef(window,"scroll",_217);
_1ef(window,"resize",_217);
};
IMHack.hackWidget=function(ele){
var _21b=ele.getElementsByTagName("div")[0];
css(_21b,{position:"absolute",bottom:"23px"});
if(_20d(ele,"buddy-list").length>0){
css(_21b,{right:"-62px"});
}else{
if(_20d(ele,"notifications").length>0){
css(_21b,{right:"-31px"});
}else{
if(_20d(ele,"status-control").length>0){
css(_21b,{right:"-1px"});
}else{
if((/\bm-chat-button-chattab\b/.test(ele.className))){
css(ele,{position:"relative"});
css(_20d(ele,"m-chat-window")[0],{position:"absolute",right:"-2px",bottom:"23px"});
}else{
css(_21b,{right:0});
}
}
}
}
};
})();
XN.namespace("ui");
(function(){
XN.ui.element={frame:null,iAmUIelement:true};
XN.array.each(["addClass","delClass","show","hide","remove"],function(i,v){
XN.ui.element[v]=function(){
XN.element[v].apply(null,[this.frame].concat(XN.array.build(arguments)));
};
});
XN.ui.container={container:null};
XN.array.each(["addChild","delChild","setContent"],function(i,v){
XN.ui.container[v]=function(){
XN.element[v].apply(null,[this.container].concat(XN.array.build(arguments)));
};
});
$extend(XN.ui.container,XN.ui.element);
})();
XN.UI=XN.Ui=XN.ui;
XN.ui.Element=XN.ui.element;
XN.ui.Content=XN.ui.container;
(function(ns){
var UI=XN.ui;
var _222=XN.event.addEvent;
var _223=true;
function log(s){
if(_223){
XN.log(isString(s)?"xn.ui.button:"+s:s);
}
}
ns.button=function(_225){
$extend(this,_225);
this.init();
};
ns.button.prototype=$extend({},UI.Element);
ns.button.prototype.text=null;
ns.button.prototype.className="";
ns.button.prototype.disableClassName="gray";
ns.button.prototype.init=function(){
var This=this;
var el;
if(this.getConfig("el")){
el=$(this.getConfig("el"));
}else{
el=$element("input");
}
this.frame=el;
el.type="button";
this.addClass("input-submit");
this.addClass(this.getConfig("className"));
this.setText(this.getConfig("text"));
_222(el,"click",function(){
if(This.onclick){
This.onclick();
}
},false);
};
ns.button.prototype.getConfig=function(key){
if(key=="el"){
return this.id;
}
return this[key];
};
ns.button.prototype.getEl=function(){
return this.frame;
};
ns.button.prototype.setText=function(text){
this.text=text;
this.getEl().value=text;
};
ns.button.prototype.disable=function(){
var el=this.getEl();
el.blur();
el.disabled=true;
el.addClass(this.getConfig("disableClassName"));
};
ns.button.prototype.enable=function(){
var el=this.getEl();
el.disabled=false;
el.delClass(this.getConfig("disableClassName"));
};
ns.button.prototype.focus=function(){
this.getEl().focus();
};
ns.button.prototype.blur=function(){
this.getEl().blur();
};
})(XN.ui);
(function(){
var rl="realLeft",rt="realTop",ow="offsetWidth",oh="offsetHeight";
XN.ui.fixPositionMethods={"1-1":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()+"px";
f.style.top=y+el[rt]()-p[rt]()+"px";
},"1-2":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()-f[ow]+"px";
f.style.top=y+el[rt]()-p[rt]()+"px";
},"1-3":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()-f[ow]+"px";
f.style.top=y+el[rt]()-p[rt]()-f[oh]+"px";
},"1-4":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()+"px";
f.style.top=y+el[rt]()-p[rt]()-f[oh]+"px";
},"2-1":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()+el[ow]+"px";
f.style.top=y+el[rt]()-p[rt]()+"px";
},"2-2":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()+el[ow]-f[ow]+"px";
f.style.top=y+el[rt]()-p[rt]();
},"2-3":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()+el[ow]-f[ow]+"px";
f.style.top=y+el[rt]()-p[rt]()-f[oh]+"px";
},"2-4":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()+el[ow]+"px";
f.style.top=y+el[rt]()-p[rt]()-f[oh]+"px";
},"3-1":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()+el[ow]+"px";
f.style.top=y+el[rt]()-p[rt]()+el[oh]+"px";
},"3-2":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()+el[ow]-f[ow]+"px";
f.style.top=y+el[rt]()+el[oh]+"px";
},"3-3":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()+el[ow]-f[ow]+"px";
f.style.top=y+el[rt]()-p[rt]()+el[oh]-f[oh]+"px";
},"3-4":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()+el[ow]+"px";
f.style.top=y+el[rt]()-p[rt]()+el[oh]-f[oh]+"px";
},"4-1":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()+"px";
f.style.top=y+el[rt]()-p[rt]()+el[oh]+"px";
},"4-2":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()-f[ow]+"px";
f.style.top=y+el[rt]()-p[rt]()+el[oh]+"px";
},"4-3":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()-f[ow]+"px";
f.style.top=y+el[rt]()-p[rt]()+el[oh]-f[oh]+"px";
},"4-4":function(f,el,x,y,p){
f.style.left=x+el[rl]()-p[rl]()+"px";
f.style.top=y+el[rt]()-p[rt]()+el[oh]-f[oh]+"px";
}};
})();
XN.ui.fixPositionElement=function(_280){
var This=this;
this.config={tagName:"div",useIframeInIE6:true};
$extend(this.config,_280);
var f,x,y;
if(this.getConfig("id")){
this.frame=this.container=f=$(this.getConfig("id"));
x=f.realLeft();
y=f.realTop();
}else{
if(this.getConfig("tagName")){
this.frame=this.container=f=$element(this.getConfig("tagName"));
}else{
return;
}
}
XN.array.each(["alignWith","alignType","offsetX","offsetY","alignParent"],function(i,v){
This[v]=This.getConfig(v)||This[v];
});
XN.element.setStyle(f,"position:absolute;z-index:10001;left:-9999px;top:-9999px");
if(!$(this.alignParent)){
this.alignParent=$(document.body);
}
$(this.alignParent).appendChild(this.frame);
if((XN.browser.IE6&&this.getConfig("useIframeInIE6"))||this.getConfig("addIframe")){
var _287;
this._iframe=_287=$element("iframe");
_287.frameBorder=0;
_287.setStyle("position:absolute;border:0px;left:0px;top:0px;z-index:-1;");
_287.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
this.frame.appendChild(_287);
}
if(XN.element.visible(f)){
this.show();
}
f.style.display="block";
};
XN.ui.fixPositionElement.prototype=$extend({},XN.ui.container);
$extend(XN.ui.fixPositionElement.prototype,{alignWith:null,alignType:"4-1",offsetX:0,offsetY:0,alignParent:"dropmenuHolder",left:null,top:null,_isShow:false,getConfig:function(key){
return this.config[key];
},setOffsetX:function(x){
this.offsetX=x;
this.refresh();
return this;
},setOffsetY:function(y){
this.offsetY=y;
this.refresh();
return this;
},setAlignType:function(t){
this.alignType=t;
this.refresh();
return this;
},setAlignParent:function(p){
this.alignParent=p;
$(this.alignParent).appendChild(this.frame);
this.refresh();
return this;
},refresh:function(){
if(this.visible()){
this.show();
}else{
this.hide();
}
return this;
},visible:function(){
return this._isShow;
},show:function(){
this._isShow=true;
if(this.alignWith){
this._moveToElement(this.alignWith);
}else{
var x=this.left===null?parseInt((($(this.alignParent).offsetWidth-this.frame.offsetWidth)/2),10):this.left;
var y=this.top===null?XN.event.scrollTop()+200:this.top;
this._moveToPosition(x,y);
}
if(this._iframe){
try{
this._iframe.style.height=this.frame.offsetHeight-2+"px";
this._iframe.style.width=this.frame.offsetWidth+"px";
}
catch(e){
}
}
return this;
},hide:function(){
this._isShow=false;
var f=this.frame;
f.style.left="-9999px";
f.style.top="-9999px";
return this;
},moveTo:function(x,y){
if(!x&&!y){
return;
}
if(isNumber(x)){
this.left=x;
this.alignWith=null;
}else{
if(isString(x)||isElement(x)){
this.alignWith=$(x);
}
}
if(isNumber(y)){
this.top=y;
this.alignWith=null;
}
this.refresh();
return this;
},setX:function(x){
this.moveTo(x);
return this;
},setY:function(y){
this.moveTo(null,y);
return this;
},setIndex:function(i){
this.frame.style.zIndex=i;
return this;
},_moveToElement:function(el){
XN.ui.fixPositionMethods[this.alignType](this.frame,$(el),this.offsetX,this.offsetY,$(this.alignParent));
},_moveToPosition:function(x,y){
if(x){
this.frame.style.left=x+"px";
}
if(y){
this.frame.style.top=y+"px";
}
}});
(function(){
var _298=XN.ui.fixPositionElement.prototype;
var _299=XN.event;
XN.ui.dialog=function(_29a){
var This=this;
XN.ui.fixPositionElement.call(this,_29a);
this.container=$element("div");
this.frame.appendChild(this.container);
if(this.getConfig("HTML")){
this.setContent(this.getConfig("HTML"));
}else{
this.setContent(this.buildHTML());
}
this.header=$("ui_dialog_header");
this.body=$("ui_dialog_body");
this.footer=$("ui_dialog_footer");
this.header.removeAttribute("id");
this.body.removeAttribute("id");
this.footer.removeAttribute("id");
this.frame.style.zIndex=10000;
this.setWidth(this.getConfig("width")||400);
if(this.getConfig("height")){
this.setHeight(this.getConfig("height"));
}
XN.array.each(["header","body","footer"],function(i,v){
if(This.getConfig(v)){
This[v].setContent(This.getConfig(v));
}
});
if(this.getConfig("type")){
this.setType(this.getConfig("type"));
}
this._buttons=[];
XN.event.addEvent(this.footer,"click",function(e){
e=e||window.event;
This._parseButtonEvent(e);
});
XN.util.hotKey.add("27",this._hotKeyEvent,this);
if(this.getConfig("modal")){
XN.dom.disable();
}
};
XN.ui.dialog.prototype=$extend({},_298);
$extend(XN.ui.dialog.prototype,{header:null,body:null,footer:null,_iframe:null,_buttons:null,buildHTML:function(){
return ["<table style=\"width: 100%; height: 100%;\" class=\"pop_dialog_table\">","<tbody>","<tr>","<td class=\"pop_topleft\"></td>","<td class=\"pop_border\"></td>","<td class=\"pop_topright\"></td>","</tr>","<tr>","<td class=\"pop_border\"></td>","<td class=\"pop_content\">","<h2><span id=\"ui_dialog_header\"></span></h2>","<div class=\"dialog_content\">","<div id=\"ui_dialog_body\" class=\"dialog_body\"></div>","<div id=\"ui_dialog_footer\" class=\"dialog_buttons\"></div>","</div>","</td>","<td class=\"pop_border\"></td>","</tr>","<tr>","<td class=\"pop_bottomleft\"></td>","<td class=\"pop_border\"></td>","<td class=\"pop_bottomright\"></td>","</tr>","</tbody>","</table>"].join("");
},getButton:function(text){
var _2a0=this._buttons;
for(var i=_2a0.length-1;i>=0;i--){
if(_2a0[i].text==text){
return _2a0[i];
}
}
return null;
},addButton:function(b){
var o={text:b.text,_onclickForDialog:b.onclick};
if(b.className){
o.className=b.className;
}
var _2a4=new XN.ui.button(o);
_2a4.frame.setAttribute("dialog","1");
this._buttons.push(_2a4);
this.footer.addChild(_2a4);
return this;
},delButton:function(b){
if(isString(b)){
b=this.getButton(b);
}
this.footer.delChild(b);
return this;
},_preventHide:false,preventHide:function(){
this._preventHide=true;
return this;
},_parseButtonEvent:function(e){
var el=_299.element(e);
if(el.tagName.toLowerCase()!=="input"||el.type!=="button"){
return;
}
if(!el.getAttribute("dialog")){
return;
}
var _2a8=this.getButton(el.value);
if(_2a8&&_2a8._onclickForDialog){
_2a8._onclickForDialog.call(this);
}
if(this._preventHide){
this._preventHide=true;
}else{
this.hide();
XN.dom.enable();
}
},_hotKeyEvent:function(){
this.hide();
},setType:function(t){
if(t=="normal"){
this.frame.delClass("errorDialog");
}else{
if(t=="error"){
this.frame.addClass("errorDialog");
}
}
return this;
},setWidth:function(w){
if(!w){
return this;
}
this.width=w;
this.frame.style.width=w+"px";
this.refresh();
return this;
},setHeight:function(h){
if(!h){
return this;
}
this.hegith=h;
this.frame.style.height=h+"px";
this.refresh();
return this;
},resizeTo:function(w,h){
this.setWidth(w);
this.setHeight(h);
return this;
},clear:function(){
this.header.setContent("");
this.body.setContent("");
this.footer.setContent("");
this._buttons=[];
return this;
},setTitle:function(s){
this.header.setContent(s);
return this;
},setBody:function(s){
this.body.setContent(s);
return this;
},remove:function(){
XN.util.hotKey.del("27",this._hotKeyEvent);
XN.ui.element.remove.call(this);
return this;
},show:function(){
this._clearHideTimer();
_298.show.apply(this,arguments);
return this;
},hide:function(){
this._clearHideTimer();
_298.hide.apply(this,arguments);
return this;
},_hideTimer:null,_clearHideTimer:function(){
if(this._hideTimer){
clearTimeout(this._hideTimer);
this._hideTimer=null;
}
},autoHide:function(t){
var This=this;
this._hideTimer=setTimeout(function(){
This.hide();
},t*1000);
return this;
}});
})();
XN.ui.panel=XN.ui.dialog;
XN.ui.dialog.prototype.setHeader=function(h){
if(h&&h!==""){
this.header.addChild(h);
}else{
this.header.innerHTML="";
}
};
XN.ui.dialog.prototype.setFooter=function(f){
if(f&&f!==""){
this.footer.addChild(f);
}else{
this.footer.innerHTML="";
}
};
XN.ui.menu=function(_2b4){
var This=this;
this.config={alignType:"4-1",barOnshowClass:"",tagName:"div",disalbeButtonClickEvent:true,fireOn:"click",keep:0.2,useIframeInIE6:true,effectTime:50};
$extend(this.config,_2b4);
var _2b6;
if(this.getConfig("text")){
this.frame=_2b6=$element(this.getConfig("tagName"));
_2b6.setContent(this.getConfig("text"));
}else{
if(this.getConfig("button")){
this.frame=_2b6=$(this.getConfig("button"));
}else{
return false;
}
}
this._alignType=this.getConfig("alignType");
if(this.getConfig("menu")){
$(this.getConfig("menu")).hide();
this.menu=new XN.ui.fixPositionElement({id:this.getConfig("menu"),alignType:this._alignType,alignWith:this.getConfig("alignWith")||this.frame,addIframe:this.getConfig("addIframe"),useIframeInIE6:this.getConfig("useIframeInIE6")});
this.container=this.menu.frame;
this._canAddSubMenu=false;
}else{
var dt=$element("div");
dt.hide();
this.menu=new XN.ui.fixPositionElement({id:dt,alignType:this._alignType,alignWith:this.getConfig("alignWith")||this.frame,addIframe:this.getConfig("addIframe"),useIframeInIE6:this.getConfig("useIframeInIE6")});
this.container=$element("div");
this._menu.setContent(this.container);
}
this.menu.setIndex(10001);
XN.event.addEvent(this.menu.frame,"click",function(e){
e=e||window.event;
This._frameOnClick(e);
},false);
this.menu.setOffsetX(this.getConfig("offsetX")||0);
this.menu.setOffsetY(this.getConfig("offsetY")||0);
var _2b9=this.getConfig("event");
if(_2b9=="click"){
XN.event.addEvent(this.frame,"click",function(e){
This._buttonClick(e||window.event);
});
XN.event.addEvent(document,"click",function(e){
This._documentClick(e||window.event);
});
}else{
if(_2b9=="mouseover"){
XN.event.addEvent(this.frame,"mouseover",function(e){
This._frameMouseOver(e||window.event);
});
if(this.getConfig("disalbeButtonClickEvent")){
XN.event.addEvent(this.frame,"onclick",function(e){
XN.event.stop(e||window.event);
});
}
XN.event.addEvent(this.frame,"mouseleave",function(){
This._buttonMouseLeave();
});
XN.event.addEvent(this.menu.frame,"mouseleave",function(){
This._menuMouseLeave();
});
XN.event.addEvent(this.menu.frame,"mouseover",function(){
This._mouseOverMenu=true;
});
}else{
if(_2b9=="manual"){
}
}
}
this.hide();
};
XN.ui.menu.prototype=$extend({},XN.ui.container);
$extend(XN.ui.menu.prototype,{isShow:true,menu:null,_alignType:null,_button:null,_canAddSubMenu:true,_delayTimer:null,_mouseOverMenu:false,_mouseOverButton:false,_clearTimer:function(){
if(this._delayTimer){
clearTimeout(this._delayTimer);
this._delayTimer=null;
}
},_buttonClick:function(e){
XN.event.stop(e);
if(this.isShow){
this.hide();
}else{
this.show();
}
},_documentClick:function(e){
this.hide();
},_frameOnClick:function(e){
var This=this;
var el=XN.event.element(e);
if(el.tagName.toLowerCase()=="a"){
return true;
}
if(el.tagName.toLowerCase()=="input"&&(el.type=="radio"||el.type=="checkbox")){
this.isShow=false;
setTimeout(function(){
This.isShow=true;
},20);
return true;
}
XN.event.stop(e);
},_frameMouseOver:function(e){
var This=this;
this._mouseOverButton=true;
this._clearTimer();
var _2c5=this.getConfig("delay");
if(_2c5){
this._delayTimer=setTimeout(function(){
if(This._mouseOverButton){
This.show();
}
},_2c5*1000);
}else{
This.show();
}
XN.event.stop(e);
},_buttonMouseLeave:function(){
var This=this;
this._mouseOverButton=false;
this._clearTimer();
setTimeout(function(){
if(!This._mouseOverMenu){
This.hide();
}
},this.getConfig("effectTime"));
},_menuMouseLeave:function(){
var This=this;
this._mouseOverMenu=false;
this._clearTimer();
setTimeout(function(){
if(!This._mouseOverButton){
This.hide();
}
},this.getConfig("effectTime"));
},getConfig:function(key){
var _2c9={"hoverClass":"barOnshowClass","event":"fireOn","button":"bar","delay":"keep"};
if(_2c9[key]){
return this.config[key]||this.config[_2c9[key]];
}
return this.config[key];
},show:function(){
if(this.isShow){
return this;
}
this.menu.show();
this.frame.addClass(this.getConfig("hoverClass"));
this.onShow();
this.isShow=true;
return this;
},setWidth:function(w){
this.menu.frame.style.width=w+"px";
this.menu.refresh();
return this;
},hide:function(){
if(!this.isShow){
return this;
}
this.menu.hide();
this.frame.delClass(this.getConfig("hoverClass"));
this.isShow=false;
return this;
},refresh:function(){
if(this.isShow){
this.menu.show();
}
return this;
},onShow:XN.func.empty,onHide:XN.func.empty});
XN.event.enableCustomEvent(XN.ui.menu.prototype);
XN.ui.autoComplete=function(p){
var This=this;
this.config=this.config||{};
$extend(this.config,{inputTip:null,searchDelay:0.2,DS:null,enableCache:true,maxCache:10});
$extend(this.config,p);
if(this.getConfig("enableCache")){
this.cache=new XN.util.cache({cacheLength:this.getConfig("maxCache")});
}
if(this.getConfig("input")){
var _2cd=this.input=$(this.getConfig("input"));
}else{
var _2cd=this.input=$element("input");
_2cd.type="text";
_2cd.addClass("input-text");
}
this.frame=_2cd;
XN.event.addEvent(_2cd,"focus",function(e){
This._startCheck();
This.fireEvent("focus");
});
XN.event.addEvent(_2cd,"blur",function(e){
This._endCheck();
This.fireEvent("blur");
});
XN.event.addEvent(_2cd,"keydown",function(e){
This._userInput=true;
e=e||window.event;
if(e.keyCode==13){
XN.event.stop(e);
}
This.fireEvent("keydown",e);
});
_2cd.setAttribute("AutoComplete","off");
this.DS=this.getConfig("DS");
};
XN.ui.autoComplete.prototype=$extend({},XN.ui.element);
$extend(XN.ui.autoComplete.prototype,{input:null,cache:null,_userInput:false,_lastInput:null,getConfig:function(key){
if(key=="input"){
return this.config["input"]||this.config["id"];
}
return this.config[key];
},_startCheck:function(){
var This=this;
this._inputTimer=setInterval(function(){
if(This._userInput){
This._userInput=false;
return;
}
This._checkInput();
},this.getConfig("searchDelay")*1000);
},_endCheck:function(){
clearInterval(this._inputTimer);
this._inputTimer=null;
},_checkInput:function(){
var This=this;
var cv=this.input.value;
if(XN.string.isBlank(cv)){
if(this._lastInput===""){
return;
}
this._lastInput="";
this.fireEvent("noinput");
return;
}
if(cv==this._lastInput){
return;
}
this._lastInput=cv;
this.fireEvent("searchbegin");
if(this.cache){
var _2d5=this.cache.get(cv);
if(_2d5){
this.fireEvent("searchover",_2d5);
return;
}
}
if(!this.DS){
XN.log("no ds");
this.fireEvent("NO_DS");
return;
}
this.DS.query(cv,function(r){
if(This.cache){
This.cache.add(cv,r);
}
This.fireEvent("searchover",r);
});
}});
XN.event.enableCustomEvent(XN.ui.autoComplete.prototype);
XN.ui.autoCompleteMenu=function(p){
var This=this;
this.config=this.config||{};
$extend(this.config,{ulClassName:"",liClassName:"",liHoverClass:"m-autosug-hover",aClassName:"",noResult:"\u6ca1\u6709\u5339\u914d\u7ed3\u679c",dataLoading:"\u6b63\u5728\u52a0\u8f7d\u6570\u636e...",noInput:null,autoSelectFirst:false});
XN.ui.autoComplete.call(this,p);
var _2d9=this.input;
var m=$element("div");
this._menuList=m;
m.className="m-autosug";
m.innerHTML="<span class=\"x1\"><span class=\"x1a\"></span></span><span class=\"x2\"><span class=\"x2a\"></span></span>";
var div=$element("div");
div.className="m-autosug-minwidth";
var div2=$element("div");
div2.className="m-autosug-content";
var ul=$element("ul");
ul.className=this.ulClass;
div2.appendChild(ul);
div.appendChild(div2);
m.appendChild(div);
this._ul=this._menuList.getElementsByTagName("ul")[0];
this.menu=new XN.UI.menu({button:_2d9,menu:m,fireOn:"manual"});
this.addEvent("keydown",this._inputOnkeydown);
XN.event.addEvent(this._ul,"mousedown",function(e){
return This._menuOnclick(e||window.event);
});
XN.event.addEvent(this._ul,"mousemove",function(e){
return This._menuOnmouseover(e||window.event);
});
XN.event.addEvent(document,"click",function(){
This.menu.hide();
},false);
this.menu.hide();
this.addEvent("noinput",function(){
var tip=this.getConfig("noInput");
if(!tip){
this.menu.hide();
return;
}
this._ul.innerHTML="<li><p>"+tip+"</p></li>";
this.menu.show();
});
this.addEvent("NO_DS",function(){
var tip=this.getConfig("dataLoading");
this._ul.innerHTML="<li><p>"+tip+"</p></li>";
this.menu.show();
});
this.addEvent("searchover",this._buildMenu);
};
XN.ui.autoCompleteMenu.prototype=$extend({},XN.ui.autoComplete.prototype);
$extend(XN.ui.autoCompleteMenu.prototype,{menu:null,_menuList:null,_ul:null,_currentLi:null,_highlightMenuItem:function(li){
if(li==this._currentLi){
return;
}
var _2e3=this.getConfig("liHoverClass");
if(this._currentLi!==null){
XN.element.delClass(this._currentLi,_2e3);
}
XN.element.addClass(li,_2e3);
this._currentLi=li;
var aid=this._currentLi.getAttribute("aid");
if(aid){
this.fireEvent("highlight",this.result[parseInt(aid)]);
}
},_inputOnkeydown:function(_2e5){
var li;
if(_2e5.keyCode==13){
if(this.menu.isShow&&this._currentLi){
var aid=this._currentLi.getAttribute("aid");
if(aid){
this._selectMenuItem(parseInt(aid));
}
}
return false;
}
if(_2e5.keyCode==38){
if(this._currentLi&&this._currentLi.previousSibling){
li=this._currentLi.previousSibling;
}else{
li=this._ul.lastChild;
}
this._highlightMenuItem(li);
return false;
}
if(_2e5.keyCode==40){
if(this._currentLi&&this._currentLi.nextSibling){
li=this._currentLi.nextSibling;
}else{
li=this._ul.firstChild;
}
this._highlightMenuItem(li);
return false;
}
return true;
},_menuOnclick:function(_2e8){
var el=XN.event.element(_2e8);
while(el&&el.tagName&&el.tagName.toLowerCase()!=="li"){
el=el.parentNode;
}
if(!el||el.nodeType!==1||!el.getAttribute("aid")){
return false;
}
this._selectMenuItem(parseInt(el.getAttribute("aid")));
return false;
},_menuOnmouseover:function(_2ea){
var el=XN.event.element(_2ea);
while(el&&el.tagName&&el.tagName.toLowerCase()!=="li"){
el=el.parentNode;
}
if(!el||el.nodeType!==1||!el.getAttribute("aid")){
return false;
}
this._highlightMenuItem(el);
return false;
},_selectMenuItem:function(id){
this.menu.hide();
this.input.focus();
this.fireEvent("select",this.result[id]);
this._lastInput=this.input.value;
},_buildMenu:function(_2ed){
var This=this;
this.result=_2ed;
if(_2ed.length==0){
var _2ef=this.getConfig("noResult");
if(isFunction(_2ef)){
_2ef=_2ef.call(this);
}
this._ul.innerHTML="<li>"+_2ef+"</li>";
this.menu.show();
this._currentLi=null;
return;
}
var lis=[];
lis.push(this.firstMenuItem());
XN.array.each(_2ed,function(i,v){
lis.push("<li aid=\""+i+"\">"+This.buildMenu(v)+"</li>");
});
lis.push(this.lastMenuItem());
this._ul.innerHTML=lis.join("");
if(this.getConfig("autoSelectFirst")){
this._highlightMenuItem(this._ul.firstChild);
}
this.menu.show();
},firstMenuItem:function(){
return "";
},lastMenuItem:function(){
return "";
},buildMenu:function(r){
return "<li>"+r.name+"</li>";
},setMenuWidth:function(w){
this.menu.setWidth(w);
}});
XN.ui.friendSelector=function(_2f5){
var This=this;
this.config=this.config||{};
$extend(this.config,{getFriendsUrl:"/getfriendsajax.do?s=1",url:"/friendsSelector.do",param:{}});
XN.ui.autoCompleteMenu.call(this,_2f5);
this.addEvent("select",function(r){
this.input.value=r.name;
if(this.onSelectOne){
this.onSelectOne(r);
}
});
this.buildMenu=function(r){
return "<p>"+r.name+"</p>";
};
this.addEvent("focus",function(){
if(this._ready){
return;
}
if(this._isLoading){
return;
}
this.loadFriends();
});
};
XN.ui.friendSelector.prototype=$extend({},XN.ui.autoCompleteMenu.prototype);
$extend(XN.ui.friendSelector.prototype,{_isLoading:false,_ready:false,isReady:function(){
return this._ready;
},isLoading:function(){
return this._isLoading;
},loadFriends:function(r){
if(this.isLoading()){
return;
}
this._isLoading=true;
var This=this;
var p={};
p["init"]=true;
p["uid"]=false;
p["uhead"]=false;
p["uname"]=false;
p["group"]=false;
p["net"]=false;
p["param"]=this.getConfig("param");
new XN.NET.xmlhttp({useCache:true,url:this.getConfig("url"),method:"get",data:"p="+XN.JSON.build(p),onSuccess:function(r){
r=XN.JSON.parse(r.responseText);
log(r);
This._onload(r);
}});
},_onload:function(r){
this.isLoading=false;
this._ready=true;
this.config.qkey=r.qkey;
this.DS=new XN.util.DS_friends({url:this.getConfig("url"),qkey:this.getConfig("qkey"),limit:this.getConfig("limit")});
}});
XN.ui.friendSelectorSynchronous=function(a,b){
function s(id,ac,v){
if(isObject(id)){
id=id.id;
}
if(v.isReady()){
try{
v[ac](id);
}
catch(e){
}
}else{
v.addEvent("load",function(){
try{
v[ac](id);
}
catch(e){
}
});
v.loadFriends();
}
}
a.addEvent("select",function(id){
s(id,"select",b);
});
a.addEvent("deselect",function(id){
s(id,"deselect",b);
});
b.addEvent("select",function(id){
s(id,"select",a);
});
b.addEvent("deselect",function(id){
s(id,"deselect",a);
});
};
XN.ui.friendSearchBar=function(p){
var _308=$(p.input);
var _309=$(p.submit||null);
var form=$(p.form);
var tip=p.tip||"\u627e\u4eba...";
var _30c=p.action||function(p){
window.location.href="http://"+XN.ENV.domain+"/profile.do?id="+p.id;
};
var _30e=false;
(new XN.FORM.inputHelper(_308)).setDefaultValue(tip).onEnter(function(el){
if(_30e){
return;
}
if(!XN.STRING.isBlank(el.value)){
form.submit();
}
});
var _310=16;
var _311=new XN.UI.friendSelector({id:_308,noResult:function(){
return "\u641c\u7d22\""+this.input.value+"\"";
},limit:_310});
_311.lastMenuItem=function(){
if(this.result.length==_310){
return "<li><p><a href=\"http://friend."+XN.env.domain+"/myfriendlistx.do?qu="+this.input.value+"\">\u70b9\u51fb\u67e5\u770b\u66f4\u591a..</a></p></li>";
}else{
return "";
}
};
_311.setMenuWidth(_308.offsetWidth);
_311.onSelectOne=function(p){
_30e=true;
_30c(p);
};
if(_309){
_309.onclick=function(){
if(_30e){
return;
}
var v=_308.value;
if(v!=tip&&!XN.STRING.isBlank(v)){
form.submit();
return false;
}
};
}
};
(function(){
XN.ui.multiFriendSelector=function(_314){
var This=this;
this._ID=XN.util.createObjID();
this.config=this.config||{};
$extend(this.config,{inputName:"ids",nameInputName:"names",url:"/friendsSelector.do",initParam:{},param:{},noInput:false,maxNum:0});
$extend(this.config,_314);
this.frame=$element("div");
var div=$element("div");
div.hide();
document.body.appendChild(div);
div.appendChild(this.frame);
this.frame.innerHTML=["<div id=\""+this.getID("friendsContainer")+"\" class=\"tokenizer friendAutoSelector\">","<span class=\"tokenizer_stretcher\">^_^</span>","<span class=\"tab_stop\"><input/></span>","<span id=\""+this.getID("inputContainer")+"\" class=\"tokenizer_input\"><input id=\""+this.getID("input")+"\" type=\"text\" /></span><div id=\""+this.getID("menu")+"\"></div>","</div>"].join("");
this.input=this.getEl("input");
this.menuContainer=this.getEl("menu");
XN.event.addEvent(this.getEl("friendsContainer"),"click",function(e){
This._parseClickEvent(e||window.event);
});
this.autoComplete=new XN.ui.friendSelector({id:this.input,inputTip:"\u8f93\u5165\u597d\u53cb\u59d3\u540d...",autoSelectFirst:true,url:this.getConfig("url"),param:this.getConfig("param")});
this.autoComplete.loadFriends=function(r){
if(this.isLoading()){
return;
}
this._isLoading=true;
var p={};
p["init"]=true;
p["uid"]=true;
p["uhead"]=false;
p["uname"]=true;
p["group"]=false;
p["net"]=false;
$extend(p,This.getConfig("initParam"));
p["param"]=this.getConfig("param");
new XN.NET.xmlhttp({useCache:true,url:this.getConfig("url"),method:"get",data:"p="+XN.JSON.build(p),onSuccess:function(r){
r=XN.JSON.parse(r.responseText);
This._allFriends=r.candidate;
This.fireEvent("load");
This.autoComplete._onload(r);
}});
};
this.autoComplete.buildMenu=function(r){
return "<p>"+r.name+"</p>";
};
this.autoComplete.setMenuWidth(129);
this.autoComplete.addEvent("keydown",function(e){
This._onInputKeydown(e);
});
this.autoComplete.addEvent("select",function(r){
XN.log(this.input);
this.input.value="";
This.selectFriend(r);
});
if(this.getConfig("noInput")){
this.input.hide();
}
this.fireEvent("init");
};
var _31e=XN.ui.multiFriendSelector.prototype=$extend({},XN.ui.element);
$extend(_31e,{isReady:function(){
return this.autoComplete.isReady();
},isLoading:function(){
return this.autoComplete.isLoading();
},loadFriends:function(){
this.autoComplete.loadFriends();
},getUserByID:function(id){
id=String(id);
var rt=null;
XN.array.each(this._allFriends,function(i,v){
if(String(v.id)==id){
rt=v;
return false;
}
});
return rt;
},getConfig:function(key){
if(key=="inputName"){
return this.config["idInputName"]||this.config["inputName"];
}
return this.config[key];
},getID:function(id){
return "mfs_"+this._ID+id;
},getFriendID:function(id){
return this.getID("friend_"+id);
},getFriendEl:function(id){
return $(this.getFriendID(id));
},getEl:function(id){
return $(this.getID(id));
},getFriendsNum:function(){
return this.getEl("friendsContainer").getElementsByTagName("a").length;
},getSelectedFriends:function(){
var rt=[];
var a=XN.array.build(this.getEl("friendsContainer").getElementsByTagName("a"));
XN.array.each(a,function(i,v){
rt.push(v.uid+"");
});
return rt;
},reset:function(){
this.deselectAll();
},deselectAll:function(){
var els=XN.array.build(this.getEl("friendsContainer").getElementsByTagName("a"));
XN.array.each(els,function(i,v){
XN.element.remove(v);
});
this.fireEvent("deselectAll",this.getIds());
},selectFriends:function(fs){
var This=this;
XN.array.each(fs,function(i,v){
This.select(v);
});
},deselectFriends:function(fs){
var This=this;
XN.array.each(fs,function(i,v){
This.deselect(v);
});
},select:function(o){
XN.log("mfs select");
var _338=this.getConfig("maxNum");
if(_338){
if(this.getFriendsNum()>_338){
this.fireEvent("overMaxNum",_338);
return;
}
}
if(isString(o)){
o={id:o,name:this.getUserByID(o).name};
}
if(this.getFriendEl(o.id)){
return;
}
this.getEl("friendsContainer").insertBefore(this.createFriendHTML(o.id,o.name),this.getEl("inputContainer"));
this.fireEvent("select",o.id);
},deselect:function(uid){
if(!this.getFriendEl(uid)){
return;
}
this.getFriendEl(uid).remove();
this.fireEvent("deselect",uid);
},_parseClickEvent:function(e){
var el=XN.event.element(e);
XN.event.stop(e);
if(el&&el.getAttribute("action")){
this.deselectFriend(el.getAttribute("uid"));
}
},createFriendHTML:function(uid,_33d){
var a=$element("a");
a.id=this.getFriendID(uid);
a.uid=uid;
a.href="#nogo";
a.className="token";
a.tabindex="-1";
a.innerHTML=["<span>\n<span>\n<span>\n<span>\n<input type=\"hidden\" value=\"",uid,"\" name=\"",this.getConfig("inputName"),"\" />\n","<input type=\"hidden\" value=\"",_33d,"\" name=\"",this.getConfig("nameInputName"),"\" />\n",_33d,"<span uid=\"",uid,"\" action=\"x\" class=\"x\" onmouseout=\"this.className='x'\" onmouseover=\"this.className='x_hover'\" >\n</span>\n</span>\n</span>\n</span>\n</span>"].join("");
return a;
},_onInputKeydown:function(_33f){
var i=this.getEl("inputContainer"),pa=i.previousSibling,na=i.nextSibling,_343=this.input,c=this.getEl("friendsContainer");
if(_33f.keyCode==8&&this.input.value==""){
if(pa){
c.removeChild(pa);
this.deselectFriend(pa.aid);
}
return true;
}else{
if(_33f.keyCode==37&&this.input.value==""){
if(pa&&pa.tagName.toLowerCase()=="a"){
i.parentNode.removeChild(i);
c.insertBefore(i,pa);
setTimeout(function(){
_343.focus();
},0);
}
return true;
}else{
if(_33f.keyCode==39&&this.input.value==""){
if(na&&na.tagName.toLowerCase()=="a"){
i.parentNode.removeChild(i);
XN.dom.insertAfter(i,na);
setTimeout(function(){
_343.focus();
},0);
}
return true;
}
}
}
return false;
}});
XN.event.enableCustomEvent(_31e);
_31e.deSelectAll=_31e.deselectAll;
_31e.deSelectFriend=_31e.deselectFriend=_31e.deselect;
_31e.selectFriend=_31e.select;
_31e.getSelectedFriendsID=_31e.getSelectedFriends;
_31e.getIds=_31e.getSelectedFriends;
})();
XN.ui.multiFriendSelectorWithMenu=function(p){
var _346=new XN.ui.multiFriendSelector(p);
var menu=new XN.ui.friendSelectorMenu({url:_346.getConfig("url"),param:_346.getConfig("param"),multi:true});
_346.menuContainer.setContent(menu);
XN.ui.friendSelectorSynchronous(_346,menu);
return _346;
};
(function(ns){
var _349=false;
var _34a=XN.event.addEvent;
log=function(s){
if(_349){
XN.log(isString(s)?"ui.tabView:"+s:s);
}
return s;
};
ns.tabView=function(_34c){
this.config={selectedClass:"select",event:"click",mouseOverDelay:0.2};
$extend(this.config,_34c);
this.init();
};
ns.tabView.prototype={_tabs:null,_currentTab:null,_idPre:null,_tabIndex:0,init:function(){
this._idPre=XN.util.createObjID();
this._tabs=[];
},getConfig:function(key){
if(key=="activeClass"){
return this.config["activeClass"]||this.config["selectedClass"];
}
return this.config[key];
},_getID:function(el){
log("_getID start");
log("param:");
log(el);
if(isString(el)){
return log(el);
}
if(el.id){
return log(el.id);
}
log("do not have id");
this._tabIndex++;
el.setAttribute("id","tabview_"+this._idPre+"_"+this._tabIndex);
return log(el.id);
},_getTab:function(id){
log("_getTab start");
log("param:id");
log(id);
if(!id){
return log(id);
}
if(id.label){
return log(id);
}
var key=this._getID(id);
log("key:"+key);
var tabs=this._tabs;
log("all tabs");
log(tabs);
for(var i=tabs.length-1;i>=0;i--){
if(tabs[i].key==key){
log("_getTab end");
return log(tabs[i]);
}
}
log("_getTab end");
return log(null);
},getCurrentTab:function(){
return this._getTab(this._currentTab);
},setCurrentTab:function(tab,_354){
log("setCurrentTab start");
var oldC=this.getCurrentTab();
var nowC=this._getTab(tab);
log("old current:");
log(oldC);
log("now current:");
log(nowC);
if(oldC&&oldC.key==nowC.key&&!_354){
return;
}
if(oldC){
this._deactiveTab(oldC);
}
this._activeTab(nowC);
this._setCurrentTab(nowC);
log("setCurrentTab end");
return this;
},reset:function(){
var tab=this.getCurrentTab();
if(tab){
this._deactiveTab(tab);
}
this._setCurrentTab(null);
return this;
},_activeTab:function(tab){
log("_activeTab:");
log(tab);
tab.getEl("label").addClass(this.getConfig("activeClass"));
if(tab.content){
tab.getEl("content").show();
}
tab.onActive(tab);
log("_activeTab end");
},_deactiveTab:function(tab){
if(tab.getEl("label")){
tab.getEl("label").delClass(this.getConfig("activeClass"));
}
if(tab.content){
tab.getEl("content").hide();
}
tab.onInactive(tab);
},_setCurrentTab:function(tab){
log("_setCurrentTab start");
tab=this._getTab(tab);
log("currentTab:");
log(tab);
this._currentTab=tab?tab.key:null;
log("this._currentTab");
log(this._currentTab);
log("_setCurrentTab end");
},addTab:function(t){
log("addTab start");
log("params:");
log(t);
var This=this;
var tab={onActive:XN.func.empty,onClick:XN.func.empty,onInactive:XN.func.empty,onInit:XN.func.empty,getEl:function(key){
return $(this[key]);
},active:false};
t.label=this._getID(t.label);
log("get label id:"+t.label);
t.key=t.key||t.label;
log("get key:"+t.key);
if(t.content){
t.content=this._getID(t.content);
log("get content id:"+t.content);
}
$extend(tab,t);
this._tabs.push(tab);
log("all tabs");
log(this._tabs);
if(tab.active&&this._currentTab===null){
if(tab.content){
tab.getEl("content").show();
}
tab.getEl("label").addClass(this.getConfig("activeClass"));
this._setCurrentTab(tab);
}else{
if(tab.content){
tab.getEl("content").hide();
}
}
var ev=this.getConfig("event");
if(ev=="click"){
_34a(tab.getEl("label"),"click",function(e){
e=e||window.event;
XN.event.stop(e);
This._eventHander(e,tab.getEl("label"));
},false);
}else{
if(ev=="mouseover"){
var _361=true;
var _362=null;
_34a(tab.getEl("label"),"mouseover",function(e){
var el=this;
_361=true;
_362=setTimeout(function(){
if(!_361){
return;
}
e=e||window.event;
This._eventHander(e,tab.getEl("label"));
},This.getConfig("mouseOverDelay")*1000);
},false);
_34a(tab.getEl("label"),"mouseleave",function(e){
_361=false;
if(_362){
clearTimeout(_362);
}
},false);
}
}
tab.onInit(tab);
log("addTab end");
return this;
},_eventHander:function(e,el){
log("on click,el:");
log(el);
log("get tab form by el:");
var tab=this._getTab(el);
this.setCurrentTab(tab);
tab.onClick(e,tab);
},refresh:function(){
this._activeTab(this.getCurrentTab());
return this;
},showTab:function(id,_36a){
this.setCurrentTab(id,_36a);
},hideAll:function(){
this.reset();
}};
XN.event.enableCustomEvent(ns.tabView.prototype);
})(XN.ui);
XN.ui.refreshAll=function(){
document.body.style.zoom=1.1;
document.body.style.zoom=1;
};
XN.effect={fadeIn:function(_36b,_36c){
if(_36b.fadetimer){
return;
}
_36c=_36c||XN.FUNC.empty;
var op=0;
_36b.setOpacity(0);
_36b.style.display="";
_36b.fadetimer=setInterval(function(){
XN.Element.setOpacity(_36b,(op+=0.2));
if(op>=1){
clearInterval(_36b.fadetimer);
_36b.fadetimer=null;
_36c(_36b);
}
},60);
},fadeOut:function(_36e,_36f){
if(_36e.fadetimer){
return;
}
_36f=_36f||XN.FUNC.empty;
var op=1;
_36e.setOpacity(1);
_36e.fadetimer=setInterval(function(){
XN.Element.setOpacity(_36e,(op-=0.2));
if(op<=0){
clearInterval(_36e.fadetimer);
_36e.fadetimer=null;
_36f(_36e);
_36e.setOpacity(1);
}
},60);
},gradient:function(_371,r,g,b,_375){
if(_371.gradientTimer){
return;
}
_375=_375||XN.FUNC.empty;
_371.style.backgroundColor="#fff";
_371.style.backgroundColor="rgb("+r+","+g+","+b+")";
_371.gradientTimer=setInterval(function(){
b+=10;
_371.style.backgroundColor="rgb("+r+","+g+","+(b>255?255:b)+")";
if(b>255){
clearInterval(_371.gradientTimer);
_371.gradientTimer=null;
_375(_371);
}
},60);
},slideOpen:function(_376){
if(_376.slidetimer){
return;
}
if(!_376.slideHeight){
var _377=_376.getStyle("position");
_376.setStyle("position:absolute;left:-99999px;top:-99999px;");
_376.show();
_376.slideHeight=_376.offsetHeight;
_376.hide();
_376.setStyle("position:"+_377+";left:auto;top:auto;");
}
var eh=_376.slideHeight,h=0;
var step=parseInt(eh/10);
_376.style.height="0px";
_376.style.display="";
_376.style.overflow="hidden";
_376.slidetimer=setInterval(function(){
_376.style.height=(h+=step)+"px";
if(h>=eh){
clearInterval(_376.slidetimer);
_376.slidetimer=null;
_376.style.height=eh;
_376.style.overflow=_376.slideOverflow;
}
},50);
},slideClose:function(_37b){
if(_37b.slidetimer){
return;
}
var eh=_37b.offsetHeight,h=eh;
_37b.slideHeight=eh;
_37b.slideOverflow=_37b.getStyle("overflow");
_37b.style.overflow="hidden";
var step=parseInt(eh/10);
_37b.slidetimer=setInterval(function(){
_37b.style.height=(h-=step)+"px";
if(h<=0){
clearInterval(_37b.slidetimer);
_37b.slidetimer=null;
_37b.style.display="none";
_37b.style.height=eh;
_37b.style.overflow=_37b.slideOverflow;
}
},50);
},scrollTo:function(_37f,_380,_381){
if(_37f.scrolltimer){
return;
}
_380=_380||10;
_381=_381||XN.FUNC.empty;
var d=_37f.realTop();
var i=XN.EVENT.winHeight();
var h=document.body.scrollHeight;
var a=XN.EVENT.scrollTop();
var _386=null;
if(d>a){
if(d+_37f.offsetHeight<i+a){
return;
}
_37f.scrolltimer=setInterval(function(){
a+=Math.ceil((d-a)/_380)||1;
window.scrollTo(0,a);
if(a==d){
clearInterval(_37f.scrolltimer);
_37f.scrolltimer=null;
}
},10);
}else{
_37f.scrolltimer=setInterval(function(){
a+=Math.ceil((d-a)/_380)||-1;
window.scrollTo(0,a);
if(a==d){
clearInterval(_37f.scrolltimer);
_37f.scrolltimer=null;
}
},10);
}
}};
XN.EFFECT=XN.Effect=XN.effect;
XN.ui.getHiddenDiv=function(){
if(!this._hiddenDiv){
this._hiddenDiv=$element("div").hide();
document.body.appendChild(this._hiddenDiv);
}
return this._hiddenDiv;
};
if(XN.FORM){
XN.FORM=null;
}
XN.Form=XN.FORM={fillWithJSON:function(form,json){
form=$(form);
var a="";
eval("(a="+json+")");
XN.FORM.fillWithArray(form,a);
},fillWithArray:function(form,a){
form=$(form);
for(var p in a){
XN.FORM.Element.setValue(p,a[p],form);
}
},setValue:function(_38d,_38e){
return XN.FORM.Element.setValue(_38d,_38e);
},getValue:function(_38f){
return XN.FORM.Element.getValue(_38f);
},serialize:function(form,type){
return this.serializeElements(this.getElements(form),type||"string");
},serializeElements:function(_392,type,_394){
type=type||"array";
if(isUndefined(_394)){
_394=false;
}
var data=[],_key,_397;
for(var i=0,j=_392.length;i<j;i++){
if(!_392[i].disabled&&_392[i].name){
_key=_392[i].name;
_397=_394?encodeURIComponent(XN.FORM.Element.getValue(_392[i])):XN.FORM.Element.getValue(_392[i]);
if(_397!==null){
if(_key in data){
if(!isArray(data[_key])){
data[_key]=[data[_key]];
}
data[_key].push(_397);
}else{
data[_key]=_397;
}
}
}
}
if(type=="array"){
return data;
}else{
if(type=="string"){
return XN.ARRAY.toQueryString(data);
}else{
if(type=="hash"){
var tmp={};
for(var p in data){
if(!isFunction(data[p])){
tmp[p]=data[p];
}
}
return tmp;
}
}
}
},getElements:function(form){
form=$(form);
var _39d=[];
var all=form.getElementsByTagName("*");
for(var i=0,j=all.length;i<j;i++){
if(!isUndefined(XN.FORM.Element.Serializers[all[i].tagName.toLowerCase()])){
_39d.push(all[i]);
}
}
return _39d;
}};
$F=function(id,type){
var el=$(id);
if(el.tagName.toLowerCase()=="form"){
return XN.FORM.serialize(el,type);
}else{
return XN.FORM.getValue(el);
}
};
XN.FORM.checkPasswordStrength=function(el,_3a5){
el=$(el);
function getStrength(str){
var _3a7=0;
var l=str.length;
if(l<=4){
_3a7+=5;
}else{
if(l>4&&l<8){
_3a7+=10;
}else{
if(l>7){
_3a7+=25;
}
}
}
var nums=0;
var _3aa=0;
var caps=0;
var mins=0;
var _3ad;
for(var i=str.length-1;i>=0;i--){
_3ad=str.charCodeAt(i);
if(_3ad>47&&_3ad<58){
nums++;
}else{
if(_3ad>64&&_3ad<91){
caps++;
}else{
if(_3ad>96&&_3ad<123){
mins++;
}else{
if(_3ad>32&&_3ad<127){
_3aa++;
}
}
}
}
}
if(caps&&mins){
_3a7+=20;
}else{
if((caps&&!mins)||(mins&&!caps)){
_3a7+=10;
}else{
_3a7+=0;
}
}
if(nums>2){
_3a7+=20;
}else{
if(nums>0&&nums<3){
_3a7+=10;
}else{
_3a7+=0;
}
}
if(_3aa>1){
_3a7+=25;
}else{
if(_3aa==1){
_3a7+=10;
}else{
_3a7+=0;
}
}
if(caps&&mins&&nums&&_3aa){
_3a7+=5;
}else{
if((caps||mins)&&nums&&_3aa){
_3a7+=3;
}else{
if((caps||mins)&&nums){
_3a7+=2;
}
}
}
var _3af;
var _3b0;
if(_3a7>=90){
_3af="\u975e\u5e38\u5b89\u5168";
_3b0=5;
}else{
if(_3a7>=80){
_3af="\u5b89\u5168";
_3b0=4;
}else{
if(_3a7>=70){
_3af="\u975e\u5e38\u5f3a";
_3b0=3;
}else{
if(_3a7>=60){
_3af="\u5f3a";
_3b0=3;
}else{
if(_3a7>=50){
_3af="\u4e00\u822c";
_3b0=2;
}else{
if(_3a7>=25){
_3af="\u5f31";
_3b0=1;
}else{
if(_3a7>=0){
_3af="\u975e\u5e38\u5f31";
_3b0=1;
}
}
}
}
}
}
}
return {"level":_3b0,"score":_3a7,"strength":_3af};
}
XN.EVENT.addEvent(el,"focus",function(){
_3a5(getStrength(el.value));
},false);
XN.EVENT.addEvent(el,"keyup",function(){
_3a5(getStrength(el.value));
},false);
};
XN.FORM.richTextEditor=function(mode,id){
this.mode=mode;
this.id=id;
this.init();
};
XN.FORM.richTextEditor.prototype={mode:null,id:null,init:function(){
if(this.mode=="advanced"){
tinyMCE.init({theme:"advanced",mode:"exact",width:"618",height:"450",elements:this.id,language:"zh_cn",plugins:"safari,emotions,media",theme_advanced_buttons1:"bold,italic,underline,|,forecolor,backcolor,emotions,|,image,media,changeMode",theme_advanced_buttons2:"fontselect,fontsizeselect,removeformat,justifyleft,justifycenter,bullist,numlist,link,unlink",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_path:false,theme_advanced_statusbar_location:"bottom",theme_advanced_resizing:true,theme_advanced_resize_horizontal:false,theme_advanced_resizing_use_cookie:1,theme_advanced_more_colors:false,theme_advanced_font_sizes:"3,4,5,6,7",theme_advanced_fonts:"\u6977\u4f53_GB2312=\u6977\u4f53_GB2312;\u9ed1\u4f53=\u9ed1\u4f53;\u96b6\u4e66=\u96b6\u4e66;Times New Roman=Times New Roman;Arial=Arial;",custom_undo_redo:false,convert_urls:false});
}else{
if(mode=="simple"){
tinyMCE.init({});
}
}
},save:function(){
tinyMCE.get(this.id).save();
},focus:function(){
tinyMCE.execCommand("mceFocus",false,this.id);
},resizeTo:function(w,h){
tinyMCE.get(this.id).theme.resizeTo(w,h);
},resizeBy:function(dw,dh){
tinyMCE.get(this.id).theme.resizeBy(dw,dh);
},show:function(){
tinyMCE.get(this.id).show();
},hide:function(){
tinyMCE.get(this.id).hide();
}};
XN.FORM.inputShadow=null;
XN.FORM.inputMethods={maxSize:9000,minSize:30,timer:null,countSize:function(show,max,_3b9){
var s=this;
show=$(show);
max=max||999999;
if(isUndefined(_3b9)){
_3b9=true;
}
var el=this.element;
function update(){
show.innerHTML=el.value.length+(_3b9?"/"+((max==999999)?"":max):"");
}
update();
XN.EVENT.addEvent(this.element,"focus",update);
XN.EVENT.addEvent(this.element,"keyup",function(){
setTimeout(function(){
var v=el.value;
if(v.length>=max){
el.value=v.substr(0,max);
XN.Element.addClass(show,"full");
this.focus();
}else{
XN.Element.delClass(show,"full");
}
update();
},0);
},false);
return this;
},setDefaultValue:function(v){
var el=this.element;
v=v||el.value;
if(document.activeElement==this.element){
el.value="";
}else{
el.value=v;
}
el.style.color="#888";
XN.EVENT.addEvent(el,"focus",function(){
if(el.value==v){
el.value="";
el.style.color="#333";
}
},false);
XN.EVENT.addEvent(el,"blur",function(){
if(el.value==""){
el.value=v;
el.style.color="#888";
}
},false);
return this;
},focus:function(_3bf){
var el=this.element;
if(el.value.length==0){
el.focus();
return;
}
if(el.setSelectionRange){
el.focus();
el.setSelectionRange(el.value.length,_3bf||el.value.length);
}else{
if(el.createTextRange){
var _3c1=el.createTextRange();
_3c1.moveStart("character",_3bf||el.value.length);
_3c1.collapse(true);
_3c1.select();
}else{
el.focus();
}
}
},onEnter:function(_3c2){
var el=this.element;
var _3c4=el.tagName.toLowerCase()=="textarea";
XN.EVENT.addEvent(el,"keydown",function(e){
e=e||window.event;
if(e.keyCode==13){
if(_3c4&&!e.ctrlKey){
return false;
}
_3c2(el);
return false;
}
},false);
return this;
},onEsc:function(_3c6){
var el=this.element;
XN.EVENT.addEvent(el,"keydown",function(e){
e=e||window.event;
if(e.keyCode==27){
_3c6(el);
return false;
}
},false);
return this;
},_autoResize:function(type,min,max){
var s=this,el=this.element;
this.minSize=min||this.minSize;
this.maxSize=max||this.maxSize;
this.type=type;
if(XN.FORM.inputShadow===null){
var d=$element("div");
d.setStyle("position:absolute;left:-99999px;top:-99999px");
document.body.appendChild(d);
XN.FORM.inputShadow=d;
}
this.shadow=XN.FORM.inputShadow;
setTimeout(function(){
if(min){
return;
}
s.minSize=type=="width"?el.offsetWidth:el.offsetHeight;
},10);
el.style.overflow="hidden";
if(XN.BROWSER.IE){
el.style.fontSize="12px";
el.style.fontFamily="'lucida grande',tahoma,verdana,arial,simsun,sans-serif";
}
XN.EVENT.addEvent(el,"focus",function(){
s.timer=setInterval(s.resize.bind(s),200);
});
XN.EVENT.addEvent(el,"blur",function(){
clearInterval(s.timer);
s.timer=null;
});
},resize:function(_3cf){
var el=this.element,sh=this.shadow,oh,type=this.type;
sh.style.fontSize=el.getStyle("fontSize");
sh.style.fontFamily=el.getStyle("fontFamily");
(type=="width")?sh.style.height=el.offsetHeight:sh.style.width=el.offsetWidth;
sh.innerHTML=XN.STRING.escapeHTML(el.value).replace(/\r\n/mg,"<br>").replace(/\r/mg,"<br>").replace(/\n/mg,"<br>");
(type=="width")?oh=sh.offsetWidth:oh=sh.offsetHeight+27;
if(oh>this.minSize&&oh<this.maxSize){
el.style[type]=oh+"px";
}else{
if(oh<this.minSize){
el.style[type]=this.minSize+"px";
}else{
if(oh>this.maxSize){
el.style[type]=this.maxSize+"px";
}
}
}
}};
XN.FORM.inputHelper=function(id){
this.element=$(id);
};
XN.FORM.inputHelper.prototype={autoResize:function(min,max){
this._autoResize("width",min,max);
return this;
}};
$extend(XN.FORM.inputHelper.prototype,XN.FORM.inputMethods);
XN.FORM.textAreaHelper=function(id){
this.element=$(id);
};
XN.FORM.textAreaHelper.prototype={element:null,autoResize:function(min,max){
this._autoResize("height",min,max);
return this;
}};
$extend(XN.FORM.textAreaHelper.prototype,XN.FORM.inputMethods);
XN.FORM.Element={getValue:function(_3da){
_3da=$(_3da);
var _3db=_3da.tagName.toLowerCase();
return XN.FORM.Element.Serializers[_3db](_3da);
},setValue:function(_3dc,_3dd,form){
if(form){
_3dc=form[_3dc];
if((isElement(_3dc)&&_3dc.tagName.toLowerCase()=="select")){
XN.FORM.Element.Serializers["select"](_3dc,_3dd);
}else{
if(isElement(_3dc)){
XN.FORM.Element.Serializers[_3dc.tagName.toLowerCase()](_3dc,_3dd);
}else{
if(_3dc[0]){
var _3df=_3dc[0].tagName.toLowerCase();
for(var i=0,j=_3dc.length;i<j;i++){
XN.FORM.Element.Serializers[_3df](_3dc[i],(_3dd[i]||_3dd||""));
}
}
}
}
}else{
_3dc=$(_3dc);
var _3df=_3dc.tagName.toLowerCase();
XN.FORM.Element.Serializers[_3df](_3dc,_3dd);
return _3dc;
}
}};
XN.FORM.Element.Serializers={input:function(_3e2,_3e3){
switch(_3e2.type.toLowerCase()){
case "checkbox":
case "radio":
return XN.FORM.Element.Serializers.inputSelector(_3e2,_3e3);
default:
return XN.FORM.Element.Serializers.textarea(_3e2,_3e3);
}
},inputSelector:function(_3e4,_3e5){
if(isUndefined(_3e5)){
return _3e4.checked?_3e4.value:null;
}else{
_3e4.checked=!!_3e5;
}
},textarea:function(_3e6,_3e7){
if(isUndefined(_3e7)){
return _3e6.value;
}else{
_3e6.value=_3e7;
}
},select:function(_3e8,_3e9){
if(isUndefined(_3e9)){
return this[_3e8.type=="select-one"?"selectOne":"selectMany"](_3e8);
}else{
var opt,_3eb,_3ec=!isArray(_3e9);
for(var i=0,_3ee=_3e8.length;i<_3ee;i++){
opt=_3e8.options[i];
_3eb=this.optionValue(opt);
if(_3ec){
if(_3eb==_3e9){
opt.selected=true;
return;
}
}else{
opt.selected=XN.ARRAY.include(_3e9,_3eb);
}
}
}
},selectOne:function(_3ef){
var _3f0=_3ef.selectedIndex;
return _3f0>=0?this.optionValue(_3ef.options[_3f0]):null;
},selectMany:function(_3f1){
var _3f2=[],_3f3=_3f1.length;
if(!_3f3){
return null;
}
for(var i=0;i<_3f3;i++){
var opt=_3f1.options[i];
if(opt.selected){
_3f2.push(this.optionValue(opt));
}
}
return _3f2;
},optionValue:function(opt){
return opt.value||opt.text;
}};
XN.FORM.tipMethods={alert:function(s,el){
XN.DO.alert(s,"\u63d0\u793a");
},div:function(s,el){
el.innerHTML=s;
XN.Element.show(el);
},tip:function(s,el){
var tip;
if(!this.tipElement){
tip=this.tipElement=new XN.UI.fixPositionElement({tagName:"div",alignType:"2-1",offsetY:-10,offsetX:170});
}else{
tip=this.tipElement;
}
if(XN.FORM.alertMethods.tipElement&&XN.FORM.alertMethods.tipElement.isShow){
return;
}
tip.setContent("<div>"+"\t\t\t\t\t\t\t\t\t\t<div class=\"regbox-t\" style=\"width: 25em;\">"+"\t\t\t\t\t\t\t\t\t\t\t<div class=\"box-outer\">"+"\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"box-inner\">"+s+"</div>"+"\t\t\t\t\t\t\t\t\t\t\t</div>"+"\t\t\t\t\t\t\t\t\t\t</div>"+"\t\t\t\t\t\t\t\t\t</div>");
tip.moveTo(el);
try{
$(el.name+"_err").hide();
}
catch(e){
}
}};
XN.FORM.alertMethods={alert:function(s,el){
XN.DO.alert(s,"\u51fa\u9519\u63d0\u793a","error");
},div:function(s,el){
el.innerHTML=s;
XN.Element.show(el);
},tip:function(s,el){
var tip;
if(!this.tipElement){
tip=this.tipElement=new XN.UI.fixPositionElement({tagName:"div",alignType:"2-1",offsetY:-10,offsetX:170});
tip.hide();
}else{
tip=this.tipElement;
}
tip.setContent("<div>"+"\t\t\t\t\t\t\t\t\t\t<div class=\"regbox\" style=\"width: 25em;\">"+"\t\t\t\t\t\t\t\t\t\t\t<div class=\"box-outer\">"+"\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"box-inner\">"+s+"</div>"+"\t\t\t\t\t\t\t\t\t\t\t</div>"+"\t\t\t\t\t\t\t\t\t\t</div>"+"\t\t\t\t\t\t\t\t\t</div>");
tip.moveTo(el);
try{
$(el.name+"_err").show();
$(el.name+"_err").delClass("hide");
}
catch(e){
}
}};
XN.FORM._helpTip=null;
XN.FORM._errorTip=null;
XN.FORM.autoChecker=function(ops){
var s=this;
this.form=$(ops.id);
if(this.form.autoChecker){
return;
}
this.submitBar=$(ops.submit)||null;
if(this.submitBar){
this.submitBar.onclick=function(e){
e=e||window.event;
XN.EVENT.stop(e);
s.submit();
return false;
};
}
this.checkers=[];
var ck,els=XN.FORM.getElements(this.form),el;
for(var i=0,j=els.length;i<j;i++){
el=els[i];
if(!el.disabled&&el.name&&el.type!="hidden"){
var ck=new XN.FORM.elementChecker({id:els[i],checkMethod:(ops.checkMethod||"auto"),alertMethod:(ops.alertMethod||"alert"),alertDiv:(ops.alertDiv||null),tipDiv:(ops.tipDiv||null),tipMethod:(ops.tipMethod||"div")});
ck.form=this.form;
ck.formControl=this;
this.checkers.push(ck);
}
}
this.form.autoChecker=true;
};
XN.FORM.autoChecker.prototype={smartSubmit:false,submit:function(){
if(this.isAllRight(true)){
this.form.submit();
}
},enableSmartSubmit:function(){
this.smartSubmit=true;
},disableSmartSubmit:function(){
this.smartSubmit=false;
},isAllRight:function(_40d){
var rt=true,cks=this.checkers;
for(var i=0,j=cks.length;i<j;i++){
cks[i].check(_40d);
if(!cks[i].passed){
rt=false;
break;
}
}
return rt;
},check:function(_412){
_412=_412||false;
var cks=this.checkers;
for(var i=cks.length-1;i>=0;i--){
cks[i].check(_412);
}
},_onupdate:function(){
if(this.smartSubmit){
if(this.submitBar){
var b=this.submitBar;
if(this.isAllRight()){
b.disabled=false;
XN.Element.delClass(b,"gray");
}else{
b.disabled=true;
XN.Element.addClass(b,"gray");
}
}
}
this.onupdate();
},onupdate:function(){
}};
XN.FORM.elementChecker=function(_416){
this.options=_416;
this.checkers=[];
this.params=[];
this.init();
};
XN.FORM.elementChecker.prototype={element:null,form:null,passed:true,alertMethod:"alert",alertDiv:null,tipDiv:null,tipMethod:"div",submitBar:null,init:function(){
var ops=this.options,el,s=this;
this.element=el=$(ops.id);
this.tip=el.getAttribute("tip");
this.error=el.getAttribute("error");
XN.EVENT.addEvent(el,"focus",function(){
if(s.tip){
s.showTip();
}
},false);
this.addRule(el.getAttribute("rule"));
if(!ops.checkMethod||ops.checkMethod=="auto"){
XN.EVENT.addEvent(el,"blur",function(){
try{
XN.FORM.tipMethods.tipElement.hide();
}
catch(e){
}
s.check();
},false);
}
this.tipMethod=ops.tipMethod;
this.tipDiv=$(ops.tipDiv)||null;
this.alertMethod=ops.alertMethod;
this.alertDiv=$(ops.alertDiv)||null;
this.options=null;
},check:function(_41a){
try{
$(this.element.name+"_ok").hide();
$(this.element.name+"_err").hide();
}
catch(e){
}
if(this.checkers.length==0){
return;
}
if(!this.form){
this.searchForm();
}
if(isUndefined(_41a)){
_41a=true;
}
var cks=this.checkers,pas=this.params,exes=XN.FORM.checkers;
this.passed=true;
var _41e=[],msg;
if(this.error){
_41e.push(this.error);
}
for(var i=0,j=cks.length;i<j;i++){
if(!exes[cks[i]].exe.call(this,pas[i])){
if(!this.error){
_41e.push(exes[cks[i]].error);
}
this.passed=false;
break;
}
}
if((!this.passed)&&_41a){
if(_41e.length==1){
msg="<p>"+_41e[0]+"</p>";
}else{
msg="<ul><li>"+_41e.join("</li><li>")+"</li></ul>";
}
this.showError(msg);
}else{
try{
$(this.element.name+"_err").hide();
$(this.element.name+"_ok").show();
$(this.element.name+"_ok").delClass("hide");
}
catch(e){
}
try{
XN.FORM.alertMethods.tipElement.hide();
}
catch(e){
}
if(this.alertDiv){
XN.Element.hide(this.alertDiv);
}
if(this.tipDiv){
XN.ELement.hide(this.tipDiv);
}
}
if(this.formControl){
this.formControl._onupdate();
}
},addRule:function(str){
if(!str){
return;
}
if(isFunction(str)){
this.checkers.push(str);
return;
}
var rs=str.split("#"),tmp;
for(var i=0,j=rs.length;i<j;i++){
tmp=rs[i].split(":");
this.checkers.push(tmp[0]);
this.params.push(tmp[1]);
}
},searchForm:function(){
var el=this.element.parentNode;
while(el!==null&&el!==document.body){
if(el.tagName.toLowerCase()=="from"){
this.form=el;
break;
}
el=el.parentNode;
}
},showTip:function(){
var tip=this.tip;
if(this.tipMethod=="alert"){
XN.FORM.tipMethods.alert(tip,this.element);
}else{
if(this.tipMethod=="div"&&this.tipDiv!==null){
XN.FORM.tipMethods.div(tip,this.tipDiv);
}else{
if(this.tipMethod=="tip"){
XN.FORM.tipMethods.tip(tip,this.element);
}else{
$(this.element.name+"_err").hide();
$(this.element.name+"_tip").show();
$(this.element.name+"_tipMsg").innerHTML=tip;
}
}
}
},showError:function(e){
if(this.alertMethod=="alert"){
XN.FORM.alertMethods.alert(e,this.element);
}else{
if(this.alertMethod=="div"&&this.alertDiv!==null){
XN.FORM.alertMethods.div(e,this.alertDiv);
}else{
if(this.alertMethod=="tip"){
XN.FORM.alertMethods.tip(e,this.element);
}else{
try{
var id=this.element.name;
$(id+"_err").show();
$(id+"_err").delClass("hide");
$(id+"_tip").show();
$(id+"_tipMsg").innerHTML=e;
}
catch(e){
}
}
}
}
}};
XN.FORM.checkers={blank:{exe:function(p){
var str=this.element.value;
return !XN.STRING.isBlank(str);
},error:"\u5fc5\u586b\u9879\u4e0d\u80fd\u4e3a\u7a7a"},email:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
return XN.STRING.isEmail(str);
},error:"\u60a8\u8f93\u5165\u7684\u4e0d\u662f\u4e00\u4e2a\u5408\u6cd5\u7684 E-mail \u5730\u5740"},phone:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
return XN.STRING.isPhone(str);
},error:"\u60a8\u8f93\u5165\u7684\u4e0d\u662f\u4e00\u4e2a\u5408\u6cd5\u7684\u7535\u8bdd\u53f7\u7801"},mobile:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
return XN.STRING.isMobile(str);
},error:"\u60a8\u8f93\u5165\u7684\u4e0d\u662f\u4e00\u4e2a\u5408\u6cd5\u7684\u624b\u673a\u53f7\u7801"},ip:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
return XN.STRING.isIp(str);
},error:"\u60a8\u8f93\u5165\u7684\u4e0d\u662f\u4e00\u4e2a\u5408\u6cd5\u7684ip\u5730\u5740"},url:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
return XN.STRING.isUrl(str);
},error:"\u60a8\u8f93\u5165\u7684\u4e0d\u662f\u4e00\u4e2a\u5408\u6cd5\u7684url"},num:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
return XN.STRING.isNum(str);
},error:"\u60a8\u53ea\u80fd\u8f93\u5165\u4e00\u4e2a\u6570\u5b57"},zip:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
return XN.STRING.isZip(str);
},error:"\u60a8\u8f93\u5165\u7684\u4e0d\u662f\u4e00\u4e2a\u5408\u6cd5\u7684\u90ae\u653f\u7f16\u7801"},en:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
return XN.STRING.isEN(str);
},error:"\u60a8\u53ea\u80fd\u8f93\u5165\u82f1\u6587\u5b57\u6bcd"},length:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
var tmp=p.split(",");
var min=parseInt(tmp[0]);
var max=parseInt(tmp[1]);
var l=str.length;
if(l<min||l>max){
XN.FORM.checkers.length.error="\u60a8\u8f93\u5165\u5b57\u7b26\u957f\u5ea6\u53ea\u80fd\u5728"+min+"-"+max+"\u4e4b\u95f4";
return false;
}
return true;
},error:""},file:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
var avs=p.split(",");
var _446=false;
for(var i=0,j=avs.length;i<j;i++){
if(XN.STRING.endsWith(str,"."+avs[i])){
_446=true;
break;
}
}
if(!_446){
XN.FORM.checkers.file.error="\u60a8\u53ea\u80fd\u63d0\u4ea4"+p+"\u683c\u5f0f\u7684\u6587\u4ef6";
}
return _446;
},error:""},include:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
if(!XN.STRING.include(str,p)){
XN.FORM.checkers.include.error="\u60a8\u8f93\u5165\u7684\u5b57\u7b26\u5fc5\u987b\u5305\u542b"+p;
return false;
}
return true;
},error:""},startsWith:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
if(!XN.STRING.startsWith(str,p)){
XN.FORM.checkers.startsWith.error="\u60a8\u8f93\u5165\u7684\u5b57\u7b26\u53ea\u80fd\u4ee5"+p+"\u5f00\u5934";
return false;
}
return true;
},error:""},endsWith:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
if(!XN.STRING.endsWith(str,p)){
XN.FORM.checkers.endsWith.error="\u60a8\u8f93\u5165\u7684\u5b57\u7b26\u53ea\u80fd\u4ee5"+p+"\u7ed3\u5c3e";
return false;
}
return true;
},error:""},custom:{exe:function(p){
try{
return window[p](this.element);
}
catch(e){
}
return true;
},error:""},compare:{exe:function(p){
return (this.element.value==$(p).value);
},error:""},sharelink:{exe:function(p){
var str=this.element.value;
if(!str){
return true;
}
if(str.substr(0,7)!="http://"&&str.substr(0,6)!="ftp://"){
this.element.value="http://"+str;
str=this.element.value;
}
if(!XN.STRING.isUrl(str)){
XN.FORM.checkers.sharelink.error="\u8bf7\u60a8\u8f93\u5165\u4e00\u4e2a\u6709\u6548\u7684\u94fe\u63a5";
return false;
}
if(/xiaonei.com/.test(str)){
XN.FORM.checkers.sharelink.error="\u60a8\u5fc5\u987b\u8f93\u5165\u4e00\u4e2a\u7ad9\u5916\u94fe\u63a5";
return false;
}
return true;
},error:""},loginName:{exe:function(p){
this.element.value=XN.STRING.trim(this.element.value);
var str=this.element.value;
if(!str){
return true;
}
var tmp="";
for(var i=0,j=str.length;i<j;i++){
var code=str.charCodeAt(i);
if(code>=65281&&code<=65373){
tmp+=String.fromCharCode(code-65248);
}else{
tmp+=String.fromCharCode(code);
}
}
tmp=tmp.replace(/·/,"@");
tmp=tmp.replace(/[。|,|，|、]/g,".");
str=this.element.value=tmp;
if(/@/.test(str)){
if(XN.STRING.isEmail(str)){
return true;
}else{
XN.FORM.checkers.loginName.error="E-mail \u683c\u5f0f\u9519\u8bef";
return false;
}
}else{
if(/^[\w@_.-]{3,50}$/.test(str)){
return true;
}else{
XN.FORM.checkers.loginName.error="\u5e10\u53f7\u683c\u5f0f\u9519\u8bef";
return false;
}
}
},error:"\u60a8\u5fc5\u987b\u8f93\u5165\u4e00\u4e2a\u7528\u6237\u540d\u6216\u8005email\u5730\u5740"}};
XN.FORM.userInfoAutoComplete=function(id,type){
var _45b={"elementaryschool":"/autocomplete_elementaryschool.jsp","juniorhighschool":"/autocomplete_juniorhighschool.jsp\t","workplace":"/autocomplete_workplace.jsp","highschool":"/autocomplete_highschool.jsp","allnetwork":"/autocomplete_all_network.jsp","allSchool":"/autocomplete-school.jsp","city":"/autocomplete-city.jsp","college":"autocomplete_college.jsp"};
var ds=new XN.UI.DS_XHR({url:_45b[type]});
var at=this.at=new XN.UI.autoCompleteMenu({DS:ds,input:id});
at.buildMenu=function(r){
return "<p>"+(r.name||r.Name)+"</p>";
};
at.addEvent("select",function(r){
this.input.value=(r.name||r.Name);
});
};
if(XN.WIDEGETS){
XN.WIDGETS=null;
}
XN.WIDGETS=XN.Widgets={};
XN.WIDGETS.navBar={menu:null,upBar:"navMenuScrollUp",downBar:"navMenuScrollDown",showAppNum:15,allApps:"navMenuAllApps",searchInput:"navSearchInput",allAppsTop:null,initAppMenu:function(){
if(!$("showAppMenu")){
return;
}
if(!$("navMyApps")){
return;
}
var _460=$("navMyApps");
if(!_460){
return;
}
_460.show();
var _461=$("showAppMenu");
var _462=133;
var menu=this.menu=new XN.UI.menu({bar:"showAppMenu",menu:"appMenu",fireOn:"mouseover",addIframe:true});
var _464=$("navAllApps");
_464.hide();
if(!$("navShowAllApp")){
return;
}
var _465=$("navShowAllApp");
if(XN.BROWSER.IE){
var _466=_464.getElementsByTagName("ul").length;
if(_466>1){
_464.setStyle("width:"+(_466*_462+3)+"px");
}
}
_465.onclick=function(e){
e=e||window.event;
XN.EVENT.stop(e);
menu.isShow=false;
menu.frame.onmousemove=function(){
menu.isShow=false;
};
_460.hide();
_464.show();
if(XN.BROWSER.IE){
if(_466>1){
menu.setWidth(271+(_466-1)*_462);
}
}
};
XN.EVENT.addEvent(document,"click",function(){
menu.frame.onmousemove=null;
menu.isShow=true;
menu.hide();
_460.show();
_464.hide();
if(XN.BROWSER.IE){
if(_466>1){
menu.setWidth(269);
}
}
},false);
},initSearch:function(){
if(!$(this.searchInput)){
return;
}
new XN.UI.friendSearchBar({input:this.searchInput,submit:$("navSearchSubmit"),form:$("globalSearchForm")});
if(!$("searchMenuAction")){
return;
}
new XN.UI.menu({bar:"searchMenuAction",menu:"searchdropdownMenu",fireOn:"mouseover"});
},initSettingMenu:function(){
if(!$("optionMenuActive")){
return;
}
new XN.UI.menu({bar:"optionMenuActive",menu:"optiondropdownMenu",fireOn:"mouseover"});
},init:function(){
this.initAppMenu();
this.initSettingMenu();
this.initSearch();
}};
XN.DOM.readyDo(function(){
if($("showAppMenu")){
XN.Widgets.navBar.init();
}
});
if(!XN.APP){
XN.APP={};
}
if(!XN.app){
XN.app=XN.APP;
}
if(!XN.app.status){
XN.app.status={};
}

